When doing wordpress backups, there are different ways to do it. You can do database backups in your hosting account c-panel or PhpMyAdmin, but that might not be enough to guarantee your safety. In the wordpress control panel, under manage, you can export an xml file which contains your posts, pages, comments, custom fields, categories, and tags. Now, when you try to import that file because of whatever reason, importing files larger than 2MB is not possible. Most exported back ups are larger than 2MB, so how can you do it?

How To Import Larger Files

In your c-panel’s file manager, or using FTP, there should be a file called php.ini in your public html directory. If there is not, you can create one with phpconfig in your c-panel. If your’s doesn’t offer that, I’ll be happy to send you a basic php.ini file you can use.

For example, your exported xml backup is 12MB. Copy php.ini into notepad or another text editor. Find the line that says:

Maximum allowed size for uploaded files.
upload_max_filesize = 2M

Change the value to 15M to compensate. You will now need to put the altered version (still titled php.ini) in your /public_html/wp-admin directory. You will now see the amount listed in your WP control panel under import is changed to 15. Go ahead and import. Sometimes, it still may not import all your posts and comments because of a max execution time out. That’s what happened to me – it only imported half of my posts. To fix this, you’ll need to edit php.ini again. Go to the lines:

max_execution_time = 30     ; Maximum execution time of each script, in seconds

Change 30 to 120 in max execution time, and it should do the trick. Once your file has been successfully imported in full, delete that php.ini file in your wp-admin folder. You may have to use a larger number if your backup is huge.

Check Your Permalink Structure

If you move to a new host, or you delete your blog so you can do a fresh install, make sure you use the same exact permalink structure from your previous site or you’ll lose all incoming links and pagerank. This blog is a brand new wordpress install on a brand new c-panel and server. I had to change my permalinks from the default to match my old site.

Once you’ve started a wordpress blog and written a lot of posts, DO NOT change your permalinks unless you know how to write a permanent 301 redirect in your htaccess file – you will lose all incoming links to your posts.

Use a Variety of Backups

You should download backups from your cpanel as your main method. Do it everyday and after every new post. These are saved as sql files and you should store them in a specific file on your computer. Save them on your computer and on your host’s server. It’s always possible that someone could hack into your c-panel (the worst possible kind of hack) and add whatever evil scripts they like. That’s where your downloaded backups come in handy. Change your c-panel password often and make sure your wordpress install uses a strong password too.

You should also export xml backups as a second safety measure because you never know what might happen. In my case, all my sql backups were useless, so I was thankful I saved those xml exports. You can never be too careful. A server can be hacked, get a virus or the building your host is in could burn down. Entrecard’s host recently had a fire, so you never know.

Share and Enjoy:
  • StumbleUpon
  • Facebook
  • Twitter