How To, Wordpress Tips  

I backup my wordpress once a month. I recommend  you backup your wordpress  too. You won’t regret  having backup, instead  you will be happy when thing go wrong. There will be always a option to go back. for most having a backup and restore is scary task. but if you do it several time it become habit. I want to explain how you even can make it fun and enjoy having full Wordpress backup!

Most important part of your wordpress to have a backup of them is wordpress database and wp-content folder.

you need to make sure you included above in your backup. other section are not much important becase you can always download wordpress core files from wordpress website. or regenerate wp-config and .htaccess  file.

However to mike life easy is best, we create one backup and include all files on server.

Doing full backup of live website

Making backup of database:

Make a database backup using wp-dbmanager wordpress plugin <– good for beginners

other good alternative are WP-phpMyAdmin <–  Good for professionals!

Making  backup of files:

Copy your wordpress files  by using a ftp program such as free ftp filezilla

Restoring from full backup to online website

Restore database from a backup

by using phpmyadmin you can transfer your backup database to online database.

do not worry. there is nothing to lost. because you already have a backup. you may need remove database if you did not checked “ADD DROP TABLE / VIEW / PROCEDURE / FUNCTION” when you did database export.

Restore files from backup to server

This section is easy. again by using ftp program you can copy back or upload all files to your server.


Note:  You can restore your backup to another website too. This way your second website become exact clone of first website. To clone your Wordpress to another Domain you need to

  • change wp-config file with new database name, user and password.
  • Change value of siteurl and home  of wp-option table in database to  new website URL ( using php my admin in new website. or using a text editor and replace the value inside sql file before restoring the database.

You can use above solution to make backup and restore of any wordpress website.

How sync my online wordpress with local  wordpress?

As coder the way I do is like this. I sync my online database to my local database. I zip my my online files and after transfer to local storage I extract them in local domain. zipped files are much smaller and copying one file from in much faster and safer  than copy all server files one by one.

To make life easier my local domain and database are same as online domain and database. so I no need change wp-config or database site and home value. So my online website will be 100% exact clone.

Working on exact clone at localhost is very fast and fun. It’s like you have tomorrow internet speed. I sync from server to local one time at end of the month. during month I work at local wordpress. If I were happy with result I transfer them to online wordpress site.

You may want to read my previous post on Simple way to backup your online wordpress website and clone or sync it to local development website by using SSH

Do you have better or easier solution? Please share it with rest of the world in comments.
I hope you enjoyed. If  still you need my assistante , I’ll be happy to help you.

  • Share/Bookmark

Add your comment


  1. ilayka
    May 3, 2010
    6:09 am

    Easy to understand, I am going to upload my blog from localhost to the Internet.


  2. Paul Coughlin
    May 22, 2010
    5:13 am

    That’s useful. There’s an even easier little trick, if you don’t mind editing your hosts file – then there’s no need to change the wp-config or database blog address values.

    Edit your hosts file to create an entry for your blog url, but use your local ip address.

    Then your offline local install won’t need any settings changed.

    The only problem, is knowing which site you are working on! – so i always edit my blog title on my local version – add *** to the beginning of the blogname.

    At the end of the month, remove the hosts entry and upload to the live site..

    all the best,
    Paul.


  3. Andy
    May 27, 2010
    1:00 pm

    Thanks Paul for your time and feedback,
    I do agree with you. I also do not like change the wpconfig. Your idea about changing title of cloned website is great. I code inside my VM machine and no need change host entry every month to switch between live website and cloned one. I only change the dns entry in VM once. I always can see cloned website in VM machine and same time, I can see the real website at my host computer. I can always switch between real website or cloned website by using foxy proxy and firefox!

    Have a great day
    Andy


  4. Luis
    July 7, 2010
    1:05 pm

    how you thought about doing it automatically?


  5. Fred
    July 20, 2010
    8:49 am

    I did a search and found your site about how to make local worpress same as server.

    You said “To make life easier my local domain and database are same as online domain and database. so I no need change wp-config or database site and home value. So my online website will be 100% exact clone.”

    How do I set up my local domain and database to be the same as the online domain and database?


  6. Andy
    July 20, 2010
    9:05 am

    Hello Fred,

    Make your IP static. let say change it to 192.168.1.5

    Then add your site domain name to the windows or linux host file

    you can find host file at windows xp under folder C:\WINDOWS\system32\drivers\etc\host

    or at Linux it is under /etc/hosts

    You need add

    192.168.0.5 yourwebsite.com
    192.68.0.5 http://www.yoursite.com

    to above files ( you OS host file)

    This way yoursite.com point to your website at your localhost and you have no longer access to yoursite.com on the internet! ( unless you change the host file)

    To avoid changing host file everytime in order to decide to access to the same website on the internet or localhost, I use VM and I setup my local host website inside VM machine.

    About having same database task is more easy. Simply export whole database ( and Not selecting all tables inside the database to export.) when you export whole database it keep database structure and by importing it to local, the database will be 100% clone.


  7. Fred
    July 20, 2010
    12:40 pm

    I tried to make the change in notepad. When I closed to save it a window opened saying “Cannot create the c:\Windows\System32\drivers\etc\hosts file.

    Make sure that the path and file name are correct.”

    I changed permission so that it was not read only, but still didn’t work. Any ideas on how to address it?


  8. Fred
    July 20, 2010
    7:23 pm

    I solved the problem. I had to copy the hosts file to another folder, change it and then copy it back to the etc folder. Now, when I open local, it does go to same URL locally. I don’t do VM. So, I assume that if I edit locally, I will need to upload files changed, or all files and the database to the server. And same in reverse, if I edit on-line. Correct? Thanks for your help.

RSS feed for comments on this post. TrackBack URL

Add your comment.





( DoFollow )

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Home | WordPress | Themes | Plugins | Download | Forum | Freelance | Resume | Projects | Service | Contact | About
Copyright 2009 Hecode.com