Zen Cart Logo
Forums / General Questions / Open a backup copy on LocalHost

Open a backup copy on LocalHost

Views: 4,397

Results 1 to 20 of 50
30 Dec 2011, 3:36 PM
#1
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Open a backup copy on LocalHost

I've been bad.
I failed to keep my local copy updated so that it matches my live site.

So I'm wondering if I can just delete my jumbled mess (on my PC) and download a copy of my site via Backup and open it locally.

Any basic How-to info would be greatly appreciated.

30 Dec 2011, 3:48 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Open a backup copy on LocalHost

You can use this tutorial for a guide. Just substitute your local machine info for the "new host" info.
I want to move my Zen Cart installation to another host or a different server

Also see the wiki for a tutorial on making a local copy of your site.

30 Dec 2011, 6:02 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,085
Plugin Contributions:
56

Re: Open a backup copy on LocalHost

One other little "tidbit" for your localhost-clone are the directories \includes\local and \YOURADMIN\includes\local. Once you've FTP'd your hosted structure to your local PC, copy \includes\configure.php to \includes\local\configure.php and copy \YOURADMIN\includes\configure.php to \YOURADMIN\includes\local\configure.php.

Export your hosted database, create your local database and import your hosted database into the local version. Modify the two local\configure.php files to reference your localhost installation, physical filepaths and local database name.

You should be good to go; just remember to never FTP the contents of the "local" directories to your hosted setup!

30 Dec 2011, 11:20 PM
#4
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

well i downloaded the backup files but WinZip can't/won't open 'em.

What do you folks use to extract them?

30 Dec 2011, 11:23 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Open a backup copy on LocalHost

I use 7zip (free from Sourceforge).

30 Dec 2011, 11:42 PM
#6
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

I'll try it...

31 Dec 2011, 2:56 AM
#7
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

Weirdness over here...:cry:

Tried 7zip....no love. Got a message during the extraction process stating the file was bad. Hmmmm...

Tried again with winzip...same sort of message.

Erased the backup file that i downloaded earlier today and am Backing up again via CPanel (Accelrated 2, if that means anything to youz guyz).

I'll download it when it's complaete and try extracting from the new backup.

Stay tuned...film at 11.

31 Dec 2011, 5:07 AM
#8
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

Well I'm doing something wrong.
I've backed up and download the file 3 times and every time I attempt to extract the files i get an error message stating that there are 2-3 erors and the files can't be extracted.

Looks like I'm going to have to FTP the file folders 1 at a time.

31 Dec 2011, 1:03 PM
#9
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

Ah the heck with it! Who needs the aggravation anyway?
Back-up-shmack-up...

Gonna bite the bullet and and start over with fresh build using ZC 1.5.

Pray for me brothers and sisters......

Somebody wanna hit the lights and lock up this thread for me?

31 Dec 2011, 8:02 PM
#10
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

Change 3 to rev Me.1

yeah i know...make up yer stinkin' mind already....

So I got the "There's an update available" email this morning and thought about doing the upgrade but rebuilding from scratch seems silly (read: STUPID) at this point, so....

Anyone have any clues as to why I keep getting errors when I attempt to extract files from my downloaded backup file.

If it matters I've been downloading via cpanel since FileZilla doesn't seem to like me as of late.

31 Dec 2011, 8:10 PM
#11
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Open a backup copy on LocalHost

Hi Serious, this may be a silly question, but...had your zipped backup actually finished downloading to your p.c before you tried to un-zip it? Sites can get rather large so your file could be a large download hence it may take a little while to download. Just a thought/stab in the dark :-)
Posted via Mobile Device

31 Dec 2011, 8:22 PM
#12
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

It was a complete download based on file size indicaated on the server and compared to the file on my HDD.

Trying to download again via FTP but neither FileZilla or Win SCP will let me see the files on my server.

To quote Charlie Brown................AAAAAAAARRRRRRGGGGGGGHHHHHHHHHH!!!

Figured out the WinSCP issue....

31 Dec 2011, 8:31 PM
#13
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Open a backup copy on LocalHost

Good luck, let us know how it goes. Dont forget its NYE too, dont work all day & night :-)
Posted via Mobile Device

31 Dec 2011, 8:35 PM
#14
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

Not to worry, I'll take a break after a bit.

If I wasn't worried about losing my customer info/order history I would start over....

3 Jan 2012, 12:55 AM
#15
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

Still stumbling along...

Finally got XAMPP installed
Got my DB copied from my hosts server and installed locally
Installed ZenCart (fresh install)
Renamed the zc_install
Renamed the Admin file
made the applicable changes in the Admin/Includes/Configure.php file (new admin name in 3 places per the wiki)

Store is accessible but I'm getting a 404 error when I try to go from the Installation screen (the last one) to the Admin Page.

What am I forgetting?

3 Jan 2012, 12:57 AM
#16
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

FWIW,
This is what's showing up in my URL bar;
http://localhost/zencart/admin/index.php

Shouldn't it have new admin name instead "admin"?

3 Jan 2012, 2:43 AM
#17
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

Figured it out. Been too long since installing a local copy of ZC...all's well now.

Back to the topic at hand.

I've made a backup on my website, copied it to my PC.

From the WIKI posted earlier in this thread, with my questions in Blue:

  1. On your NEW host, create a new MySQL database. Note the username, password, database name, and host name (usually localhost). Done

  2. Go to your NEW host and upload (FTP) a fresh NEW install using the same version files that you built your other site on.... this will make sure that you get the proper settings in your configure.php files...
    While installing, allow it to install the demo products, so that you can test and be sure that it's working nicely.Done
    a. Install (IMPORTANT: when asked about the database-table-prefix during Database-Setup, use the same prefix that your old store uses. You'll find that in the DB_PREFIX setting of your old store's configure.php file.)Done
    b. Test it.Done
    c. Make backups of the NEW server's /includes/configure.php and /admin/includes/configure.php files by downloading them (FTP) to your PC. Done

  3. On your OLD host, Make a COMPLETE backup of your DATABASE and STORE.
    a. Use either the "Backup MySQL Database" contribution to do the backup of your database, or use phpMyAdmin to export your entire database ... include the "DROP" tables command, and under Data, choose "Complete Inserts" and "Extended Inserts".
    Save the SQL file to your PC for later. Click here for tips on using phpMyAdmin to export database. Done
    b. Download all your old site's files via FTP (or if you have the option, zip them up on the server and download the zip)**Wait, wait, WAIT!!
    All of the files? Seems to me that there are cpanel files I don't need. When I did afull backup should all of the files have been included in the backup? see my file list below..

    **

  4. Now upload your OLD files over the NEW files on the NEW server, WITH TWO EXCEPTIONS: Don't overwrite the /includes/configure.php and /NAME_OF_YOUR_RENAMED_ADMIN_FOLDER/includes/configure.php files on the NEW server.

  5. Go back to phpMyAdmin on your NEW server.
    a. Select your NEW database (that you installed the NEW Zen Cart into)
    b. DROP all the tables. (Check them all and scroll down and on "With Selected..." select DROP. Confirm Yes.
    c. Click on the SQL tab across the top (or "Import" on newer phpMyAdmin configurations) and click Browse.
    d. Select the SQL file you made in step 3a when you exported your old database, and click Go. When i set up my local ZC store earlier today i used a backcopy ogf the DB from my live site. Do i need to do this step again? They both have the same names/tables.

  6. Grab the "Fix_Cache_Key" utility to reset your Admin->Sessions->Session Directory key so that it uses the proper folder path for your new server:
    http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_54&products_id=82

Simply upload the file to your NEW Zen Cart folder and open fix_cache_key.php in your browser. It will give you status messages. Delete fix_cache_key.php when you're finished.
Is step 6 required for a local installation?

Regarding #3 above.
This is a list of all of the folders currently on my site:
(/home/NAME)
.cpanel
.htpasswds
.HttpRequest
.installatron
.MirrorSearch
.sqmailattach
.sqmaildata
.trash
access-logs
etc
FEC
IH2
mail
public_html
sitemapXML
ssl
Store_Root
tmp
www

Will I need all of these?

3 Jan 2012, 2:51 AM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Open a backup copy on LocalHost

Re: #3 -- The point was referring to your Zen Cart files. Everything outside of the Zen Cart files is outside the scope of the Zen Cart instructions.

3 Jan 2012, 2:57 AM
#19
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Open a backup copy on LocalHost

That's what I thought, just wanted to be sure.
So Red gets left behind (so to speak)

.cpanel
.htpasswds
.HttpRequest
.installatron
.MirrorSearch
.sqmailattach
.sqmaildata
.trash
access-logs

etc
FEC
IH2
mail
public_html
sitemapXML
ssl
Store_Root
tmp
www

3 Jan 2012, 3:56 AM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Open a backup copy on LocalHost

No. EVERYTHING gets left behind, except whatever files under public_html belong to your Zen Cart piece.

public_html is where your live website content exists. If your Zen Cart files are directly in public_html then you'll pay attention to what's in public_html. If your Zen Cart files are in a subdirectory under public_html, then it's that subdirectory to focus on. Anything else is entirely outside the scope of Zen Cart, and you'll need to assess those yourself.