Zen Cart Logo
Forums / General Questions / Can I restore a single file from the backup?

Can I restore a single file from the backup?

Locked

Views: 1,620

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
13 Feb 2009, 3:43 PM
#1
butchx5 avatar

butchx5

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Can I restore a single file from the backup?

Hi
As I was doing some fiddling today I did a back up of my site. As I suspected I cocked up and deleted a file I wanted. It is the tpl_footer.php. I had made changes to it which made it quite different to the template default and rather than redo all the work I want to upload JUST this back up file to my site -

Can I do this?
How do I do this?

Thanks

13 Feb 2009, 4:03 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can I restore a single file from the backup?

Just put your backed up copy of the tpl_footer.php to where you have the bad file ...

NOTE: If you have no changes to this file, you could just delete your bad file in your templates and overrides directory and the default file will start being used again ...

13 Feb 2009, 4:10 PM
#3
butchx5 avatar

butchx5

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Can I restore a single file from the backup?

Hi
Thanks for the response - can I just sheepishly ask :blush:

How do I locate the single backup file so I can replace it?

I tried doing a restore last week (of the whole site if I remember correctly) and lots of files didn't work and I had to reload all the template default files - which meant I lost a lot of my customisation.

Thanks for your help

13 Feb 2009, 4:23 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can I restore a single file from the backup?

tpl_ files are in the templates ...

Default Templates:
/includes/templates/template_default

Custom Templates:
/includes/templates/your_template_dir

The tpl_footer.php if you do not know its location can be found with the help of the Tools ... Developers Tool Kit ... in your Zen Cart Admin ...

In the bottom input box, type in:
tpl_footer

Select Catalog from the Dropdown and click Search ...

You will now see where the file is located as well as places in the code where the file is called from ...

The Developers Tool Kit can be used to find a php filename location, text, code, etc.

The Top input box can also be used to find the location of the CONSTANTS stored in the configuration tables ...

13 Feb 2009, 5:00 PM
#5
butchx5 avatar

butchx5

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Can I restore a single file from the backup?

Hi

Thanks for your detailed reply - unfortunately, I wasn't so clear in my reply - I know where the file is within in my site etc.

The thing I am not sure about is where the backup file is - well that's not true I can see the back up on my site directory but if I click on it to open the backup and view the files so I can copy just the one file I need it takes forever and stops responding. Could this be as I have used the space I am allocated on my server and so cannot open the back up?

Next time I will save the backup to my own PC. Hindsight is a wonderful thing.:yes:

Any help/ideas would be great.

13 Feb 2009, 5:10 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Can I restore a single file from the backup?

What FORMAT is the backup file? If it is a tar.gz or a zipped up file of some kind, you can FTP this back to your hard drive and use an unzip program to extract it (7zip is freeware on the www and will open up tar.gz files).

Then you can locate your broken file on your hard drive copy, and FTP it back to its directory.

When working on PHP or CSS files, it's not generally necessary to do a full backup of the home directory - just make a backup of the individual file you are editing.

With the database, it's a different story... It's good practise to do a full backup of the database when doing dbase changes.

13 Feb 2009, 5:16 PM
#7
butchx5 avatar

butchx5

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Can I restore a single file from the backup?

Hi

yes it is a tar.gz file and I also have 7zip. You can tell I haven't a clue when I now ask -

how/what/when/where do I FTP it to my harddrive and then FTP it back to my site?

I really am making myself look silly now :wacko: but I would like to work this out as I can see I will need it in the future!

Helen

13 Feb 2009, 5:22 PM
#8
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Can I restore a single file from the backup?

Do you have a FTP program (such as FILEZILLA) ?

13 Feb 2009, 5:44 PM
#9
butchx5 avatar

butchx5

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Can I restore a single file from the backup?

Hi

Yes I have filezilla - looked up FTP on the net and now know a little more.

I am (hopefully) transfering the backup file as I type - fingers crossed it all works - I'll get back and let you know.

13 Feb 2009, 5:50 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Can I restore a single file from the backup?

Filezilla (as with any FTP program) allows you to see files on your LOCAL computer and another (usually REMOTE) computer - the server.

These two computer drives are represented by the two "frames" seen on the screen. One will be your local machine. The other the remote machine.

FTP (File Transfer Protocol) software enables you to create a LINK between your machine and the remote machine, and to move data and files between the two.

There are TWO main transfer formats:
ASCII
and
BINARY

Many files require FTP in BINARY mode. You should google this to see what file extensions require what mode.

13 Feb 2009, 5:53 PM
#11
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Can I restore a single file from the backup?

... By the way...

How were you editing the tpl_footer.php before you discovered FTP ???

I'll bet you were doing this via your host C-Panel !

(Naughty Naughty!)

That's probably what fouled up the file.

Don't use that edit function. Download CRIMSON EDITOR or NOTEPAD++ and use ONLY THAT to edit your ZC files.

13 Feb 2009, 7:17 PM
#12
butchx5 avatar

butchx5

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Can I restore a single file from the backup?

Hi again

Yes I have been very naughty!
I was very new to Zen Cart and didn't have any idea at all about how it worked.
My webhost loaded up the software and I blindly went ahead making changes using the forum and I didn't realise I should be using an FTP system and tutorials to work out what I thought I should be doing - generally it all worked, but when it did go wrong it went very wrong and I now suspect it is just as you guessed.

Unfortunately, this evening I cannot get to grips with filezilla and how I am supposed to operate it. More by chance than anything else I have managed to isolate the file I want but now matter what I do I cannot get it to upload back to the site - it appears to work but when I check the file is empty. I also notice that the googleanalyticals file is also enpyt (it was that I was installing when I lost the footer file)

Could this be down to my web disc space being overfilled?

Am now hitting the vodka - so need to sort this asap before I am indisposed!

13 Feb 2009, 7:37 PM
#13
butchx5 avatar

butchx5

New Zenner

Join Date:
Nov 2008
Posts:
69
Plugin Contributions:
0

Re: Can I restore a single file from the backup?

Hi again

Well, I did it my way, as the song goes, and so far it is working - fingers crossed it will continue to work.

The footer is now back to what I wanted and I'll configure the google analystics next week.

Thank you for all your help and support.

I'll work out filezilla asap as I realise this is what I should be using to adjust my site.

Have a good weekend.

Helen :cheers: