1

I installed the newest Magento version (1.9.1) on a linux server. I have the cPanel available to me in my cloud hosting package.

I remember some time back when I had a VPS hosting plan that something went wrong with my Magento shopping cart and I needed to have everything restored from a backup. I asked the hosting company to use the last backup (I had a 'once a day' backup plan back then) but they had a very difficult time restoring from the regular backup (something with the tables, the database or something or other). So - here is the million dollar question - I am now getting ready to install an extension via Magento Connect - How should I backup my entire Magento store? (files and database). Shall I download all my files via FTP or can I backup everything from the cPanel? What about the database?

Thank you very much for any suggestions. I know there are a lot of smart people out there who know this stuff (unlike me :-) )

Allysin

2
  • How do I make a dump of the database? I understand that I can download the files via FTP or through the cPanel but I'm really concerned about the database (since they had A LOT of trouble restoring it last time). I thought I read something somewhere a long time ago that you can't expect to restore from a cPanel database backup. This "dump" you are all talking about is like a database export and I would import that data into a new clean database??
    – Allysin
    Apr 22, 2015 at 20:23
  • Use mysqldump. The general syntax is mysqldump -u yourname -p dbname > filename.sql Just replace yourname and dbname with the actual names. Filename should be something descriptive such as BackupBeforeNewEmailExtension_Aug-5-2015.sql.
    – tzvi
    Aug 5, 2015 at 20:54

2 Answers 2

3

The absolute simplest method.

If you have SSH access and the disk space, the easiest way is to create a tarball (archive similar to windows Zip) of your webserver doc root and a compressed mysqldump of the database to a backup folder in your home directory (above your web server doc root so it's not web accessible).

Use SFTP to download the tarball and database backup to local storage. With only two files, it goes a lot quicker and is less likely to suffer errors than a long excruciating SFTP download of each individual file in the Magento installation.

Also, if you have Amazon Web Services, you can create an S3 bucket and use S3command to copy your backup files to that (goes the quickest)

(If you have a version of Magento that has System and Database backup, DO NOT USE THESE! They often knock your site offline with a 500 error do to messing with file permissions)

0

What I do is I have a staging environment(staging.exemple.com) connected to a git repo and I test everything on that staging environment. So for example, if I wanted to install a new extension I would install it using magento connect on the staging then test it out. If everything works fine I'll do a database dump on my production site then I'll push my staging to my repo then pull it from my production site. From there your extensions should now be installed to the production site, and you don't have to worry about copying the database from your staging to your production since the extensions files as all the information to modify the database.

Using the git repo will allow you to have a detailed history/backup of your code.

If you're new to the git repo's it might be a lot to learn at first but I assure you that it's well worth it.

*PS. Don't include your media folder from your magento into your git repo. It will save you time and space.

2
  • Hi Frank, Thank you so much for this suggestion...to be honest - I don't know what a 'git repo' is? Are there any resources I can look at to learn about this? My main focus is - I have spent a lot of time changing the graphics of my Magento store and also added hundreds of products already and I really don't want to loose all that (it did happen to me once before). So - I'm up for anything that will work...Thanks again! ;-) Allysin
    – Allysin
    Apr 22, 2015 at 13:38
  • Hey Allysin, If you don't plan on modifying your code too often you can also just got into your file manager from your cpanel and create a zip file of your entire store. FOr the database you can still use a simple dump to back it up before you make any changes. If you want more info about git I would suggest this guide <git-scm.com/book/en/v1/Getting-Started>. It's a lot of reading so you can probably find good videos about this also. Let me know if you have any questions.
    – Frank
    Apr 22, 2015 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.