Zen Cart Logo
Forums / General Questions / How to test in an offline environment?

How to test in an offline environment?

Views: 5,932

Results 21 to 40 of 45
3 May 2011, 5:24 PM
#21
tamuren avatar

tamuren

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

How to test in an offline environment?

I gave up on XAMPP because I couldn't make it work. Now I am trying to install Zen Cart from the installation package I inserted into /public_html/Site_Clone of the live site.

3 May 2011, 5:33 PM
#22
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: How to test in an offline environment?

What can sometimes happen is that you create a database in the hosting control panel, and create a User for it and attach a Password to that User - but don't link that User and Password access to that database.

In cPanel (for instance) if you click on the MySQL Databases link you can set up a database, and then set up a User and Password - but you could miss the lower part of that page where you assign that User and Password to that database. Whereas if you use the MySQL Database Wizard link you don't have that problem.

Can you check that?

Vger

3 May 2011, 5:36 PM
#23
tamuren avatar

tamuren

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: How to test in an offline environment?

Vger:

What can sometimes happen is that you create a database in the hosting control panel, and create a User for it and attach a Password to that User - but don't link that User and Password access to that database.

In cPanel (for instance) if you click on the MySQL Databases link you can set up a database, and then set up a User and Password - but you could miss the lower part of that page where you assign that User and Password to that database. Whereas if you use the MySQL Database Wizard link you don't have that problem.

Can you check that?

Vger

Worked. I went to MySQL databases and added user 'ongrade_admin' to database 'ongrade_zc1'. Thank you very much, hopefully it's smooth sailing from here on out! :blush:

3 May 2011, 5:44 PM
#24
tamuren avatar

tamuren

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: How to test in an offline environment?

Did not work. :(

I finished the installation and wrote down the address where I could access the next test store (https://www.on-grade.ca/site_clone/store), but when I enter that address into the address bar I get 404'd. I tried to go back to reconfirm that I wrote the write address down, but then Zen Cart installation started freaking out and wanted to go through the installation process again. I closed it, and returned here.

I know I need to do some stuff like modify the configure.php files and delete zc_install, but I should not be getting 404, should I?

3 May 2011, 6:02 PM
#25
tamuren avatar

tamuren

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: How to test in an offline environment?

My problem, expressed visually:

[IMG]http://img854.imageshack.us/img854/1466/unledes.png[/IMG]

And yet we still receive this...

[IMG]http://img24.imageshack.us/img24/1831/safhx.png[/IMG]

I want to poke my eyeballs out. This has been a terrible work-term so far.

edit: Oh, what do you know. You need to type https://www.on-grade.ca/Site_Clone/store. See the capitals?

...I'm gonna go grab a fork.

3 May 2011, 6:46 PM
#26
tamuren avatar

tamuren

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: How to test in an offline environment?

So I can now confirm that I have made another Zen Cart installation on the live server. Now, how do I configure the configure.php file to make the new installation look like the live site? I've downloaded the two PHP files but I'm not sure where I need to make my changes.

3 May 2011, 10:28 PM
#27
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to test in an offline environment?

I've downloaded the two PHP files but I'm not sure where I need to make my changes.
If you used the installer and a new datadabase and it created these 2 files. They are correct and need no editing

You need to know what version you just installed and what version the live site is

If the same - - copy all the live site files to your /Site_Clone directory replacing the files there

BUT DO NOT copy the or replace the 2 configure files

Then do a DB Backup of the line site and import it into the new DB for the clone

This tutorial outlines how
https://www.zen-cart.com/tutorials/index.php?article=103

4 May 2011, 12:44 PM
#28
tamuren avatar

tamuren

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: How to test in an offline environment?

Thank you for the help, this should be the last step to get this working. :)

However, when I was installing the test version of Zen Cart I didn't create a new database; rather, I had the new installation access the live database. Is there a problem with this approach? I'm making a clone so I can try out new mods and improve the layout of the website, so I have no plans to delete/add products. Is there a security issue or other problem with having my clone access the live database?

4 May 2011, 1:14 PM
#29
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: How to test in an offline environment?

Well, here are my thoughts:

  1. It's crazy to use the live database for the development website. You won't be able to change any settings or carry out any test without impacting the live website.

  2. If the Zen Cart versions are different then the database would also have to be different (different tables, different fields).

  3. "so I can try out new mods", which often means updating the database.

Vger

4 May 2011, 2:02 PM
#30
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to test in an offline environment?

No more need be said on "why"... Create a new db, import the existing db into it, and edit your configure.php files to point to the new db. Then you may need to run zc_install to "upgrade" the db.

4 May 2011, 5:51 PM
#31
tamuren avatar

tamuren

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: How to test in an offline environment?

I can confirm that both Zen Cart websites use the latest version of Zen Cart. I followed gjh42's instructions on creating a new database and importing the data. Then I named it ongrade_zc2, and downloaded both configure.php files to modify them as shown below:

[IMG]http://img685.imageshack.us/img685/2894/unlesasd.png[/IMG]

I also copied all the files under the directory 'public_www', except for directory 'Site_Clone' to a folder on my desktop so I could insert them into the directory 'Site_Clone'

[IMG]http://img705.imageshack.us/img705/7313/unleddi.png[/IMG]

After that, I used Filezilla to insert all of those files into the directory 'Site_Clone'. I am currently waiting for Filezilla to complete the transfer, but it looks like it's going to take a couple of hours (Queue: 750 MiB, transfer rate of about 20 KB/s)

5 May 2011, 1:10 AM
#32
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to test in an offline environment?

transfer rate of about 20 KB/sOuch :)

5 May 2011, 2:31 AM
#33
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How to test in an offline environment?

Somewhere on the forum is a post I made some time ago explaining in detail, the procedure to create a CLONE of an existing site, into a SUB-FOLDER on the server.

If you do an advanced search for "clone a zencart site" you may pick it up. Filter by my username - schoolboy.

To show you an example of a CLONED site:

http://www.karenscakes.co.uk
http://www.karenscakes.co.uk/newstore

(I have disabled htpassword for a couple of days, on the newstore site, so take a look).

The purpose for creating this clone was to try a different template and some new modules. By creating a CLONE, I can test my ideas without breaking the functional site.

Bear in mind that BOTH the files AND the database were cloned (duplicated). You do not want to run the CLONE off the live database!

(PS... it can take less than 10 minutes to create a site clone using C-Panel and phpMyAdmin.)

5 May 2011, 11:26 AM
#34
tamuren avatar

tamuren

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: How to test in an offline environment?

schoolboy:

Somewhere on the forum is a post I made some time ago explaining in detail, the procedure to create a CLONE of an existing site, into a SUB-FOLDER on the server.

If you do an advanced search for "clone a zencart site" you may pick it up. Filter by my username - schoolboy.

To show you an example of a CLONED site:

http://www.karenscakes.co.uk
http://www.karenscakes.co.uk/newstore

(I have disabled htpassword for a couple of days, on the newstore site, so take a look).

The purpose for creating this clone was to try a different template and some new modules. By creating a CLONE, I can test my ideas without breaking the functional site.

Bear in mind that BOTH the files AND the database were cloned (duplicated). You do not want to run the CLONE off the live database!

(PS... it can take less than 10 minutes to create a site clone using C-Panel and phpMyAdmin.)

I followed the advice on that thread, and you were right; it took me about 5 minutes to copy the files to a new folder and edit the .php files. That has got to be the biggest slap in the face of all...I've been working on this since friday. Ah well, at least I learned some things about Zen Cart and can begin to make some changes...

5 May 2011, 4:29 PM
#35
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How to test in an offline environment?

Tamuren:

That has got to be the biggest slap in the face of all...I've been working on this since friday. Ah well, at least I learned some things about Zen Cart and can begin to make some changes...

There's nothing wrong with not knowing how to do something. Don't feel embarrassed by taking time and trouble to discover processes.

That's how we all learn. A few years ago I was also at sea with most of this stuff.

30 Jun 2011, 2:13 AM
#36
cocolala avatar

cocolala

New Zenner

Join Date:
Jan 2010
Posts:
31
Plugin Contributions:
0

Re: How to test in an offline environment?

Hi, i already have a website which is previously done by the designer. Now I would like to test the 'Better Together' mod and need to test in an offline environment. Can anyone teach me a step by step to create this offline test website?

30 Jun 2011, 2:39 AM
#37
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to test in an offline environment?

See post #5 in this thread.

30 Jun 2011, 12:55 PM
#38
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: How to test in an offline environment?

If I'm wrong then I apologise, but I think the request was more basic than that e.g. how to set up an offline web server.

  1. Assuming you use a PC and not a Mac then go to http://www.apachefriends.org/en and download the latest "Installer" version of XAMPP, which is an all-in-one offline web server.

  2. Install it on your PC - and set up a MySQL User and Password at http://localhost

  3. Create a folder inside the 'htdocs' folder and put all of your Zen Cart folders and fies in that new folder.

  4. Go to http://localhost/phpmyadmin and set up a new database.

  5. Download a backup of your online database and "Import" it into the new offline database.

  6. Edit both configure.php files to match the offline environment e.g. http://localhost/foldername instead of http://www.yourdomain.com and something like c:/xampp/htdocs/folder-name for the DIR_FS pathways.

Vger

30 Jun 2011, 2:06 PM
#39
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to test in an offline environment?

Yes, I guess "essentially the reverse of this tutorial" doesn't actually explain anything about setting up XAMPP...

1 Sep 2011, 5:59 PM
#40
tamuren avatar

tamuren

New Zenner

Join Date:
Apr 2011
Posts:
95
Plugin Contributions:
0

Re: How to test in an offline environment?

Hey guys, sorry for reviving a dead thread but I was wondering: what .php files need to be altered on the clone site to use the clone database? The original clone I made a couple months ago was wiped out by the shorten url module.