Web Hosting Forum | Lunarpages

Web Hosting Guidance and Advice => Web Hosting Help and Troubleshooting => Topic started by: beforewisdom on December 22, 2017, 10:37:52 AM

Title: Problems Exporting & Importing WordPress Blog databases
Post by: beforewisdom on December 22, 2017, 10:37:52 AM

I would like to delete my WordPress blog and then reinstall it.

In preparation for that I have been testing making and importing database backups with phpMyAdmin and it is failing.

If I export my WordPress blog database to a *.sql file, I get told the file is too large to import ( back into a dummy test database ).

When I try to save my WordPress blog to a *.sql.zip file phpMyAdmin fails with this message:

"Firefox canít find the file at https://login.segonax.lunarpages.com/cpsess4182053861/3rd....."

How can I get around these problems?

Do I need to? If I delete my wordpress installation through CPanel, will CPanel delete my WordPress blog database?
Title: Re: Problems Exporting & Importing WordPress Blog databases
Post by: MrPhil on December 22, 2017, 11:10:20 AM
I think it would be safer to assume that using cPanel to delete your WP installation will delete its database, too. If it has data you want to preserve, you should make a backup. I don't think you need to send it down to your PC and then back up, although having a copy off the server would be safer.

As to the inability to import this database because it's too large (i.e., takes too long to run the import), have you tried using an editor to break up the .sql file into smaller pieces? You would use a normal text editor to do something like this. You need to be careful to make sure that a table is defined (CREATE) before you try to import (INSERT INTO) data into it. You might try putting all the CREATE statements into the first .sql file, and import that, and then break up the rest of the original backup into small enough .sql files that you can import each of them.

If you've already wiped your installation and database, it may be a moot point, but if you haven't, consider a manual install of WP, without wiping out the database (just install the files). Or, rename your database, wipe out and reinstall WP (you might have to have a copy of the DB present, so cPanel/Softaculous will be happy), erase your newly created database, and rename your old one back in. There are lots of ways you could potentially do this. By the way, do you have evidence that your files were corrupted, but the database is OK? If the database is corrupted for one reason or another, you can reinstall a million times and nothing will get better.

Worst case, open a support ticket to have support import your database backup without being subjected to phpMyAdmin time limits.
Title: Re: Problems Exporting & Importing WordPress Blog databases
Post by: beforewisdom on December 22, 2017, 11:46:59 AM
I'm safe, the experiments I tried were on backups and dummy databases.

I opened a ticket to discuss my site being down a lot with 500 Internal Server errors.  I was told I was using up either my CPU or memory allotment.  I only get a few hits a day so they told me that I might have malware.   I asked them to scan my blog.  They gave me a list of POSSIBLY infected files and did NOT mention the database so I am assuming it is okay.

Is there a way I can scan and clean the database?
Title: Re: Problems Exporting & Importing WordPress Blog databases
Post by: MrPhil on December 22, 2017, 12:54:34 PM
I'm not familiar enough with WordPress to be able to tell you what and how to scan. You might want to take a look at the Third Party scripts section of this forum, to see if anyone has written anything there, and then head on over to a WordPress support forum (I think there's one on wordpress.org). If you upgrade to a more recent version of WP, you might have to take some actions to update your database format, to be compatible. Don't discard your backup until you've done this!

If you're getting 500 errors, check that your WP version is up to date or if it needs upgrading, and whether it's happy with the PHP level on your server (via phpinfo() call). There are a lot of things that can cause a 500 error, so go through the list at http://www.catskilltech.com/FreeSW/faqs/index.html#err500, especially if your blog has been around for a while and might have some old .htaccess or php.ini entries. It's certainly possible that there's malware on your site, especially with popular and widely-used software such as WP. Have you made any changes or edited any files lately? Has your server been upgraded recently (server software, PHP level, etc.)? Look at the "last modified" timestamp on each file -- anything jump out as changed more recently than you know you did anything? That could be a sign of a hack or malware.