0

I had an old WordPress site that was neglected for several years. It had been hacked, and I disabled it. I'd like to now get it back up and running with the latest version (5.5.1).

I see from the version.php file that it was running WordPress version 4.5.16, and $wp_db_version was 36686. From what I can tell, the database does not have any corruption in it, just the old files. I have set up a new area for the website on a fresh server. My question is: Should I install the latest version right away and connect it to the old database data, or would it be better to download a fresh, uncorrupted copy of version 4.5.16, get that working, and then update it to the current version? Is there anything in the database from the old site that will give me problems if I try to run 5.5.1 without going through the update process? If I go straight to 5.5.1, will the software automatically update the database itself somehow?


Further explanation:

The site, where it was, is disabled; I will not be logging into the old site. What I do have is all the files and the database backed up. My question is: When I put this on a new server and get it back up and running, should I use the old WordPress core files (or better yet, download a fresh copy of 4.5.16), get that working with my database, and then update everything to the latest version? Or would it be better to skip that step, install the latest and greatest WordPress core files, and restore my old database in that?

As far as user content goes, the theme was a child theme for TwentyTen that I wrote myself; I will take care of restoring that and making sure it is updated and secure. The only other content files are images that I can restore. My question is specifically about which version of the WordPress core files I should connect to the database first.


PHP version: On my new server, the oldest PHP version I can run is 7.2. Would I even be able to run and update WP 4.5.16 under PHP 7.2?

1

I decided not to try to install WP version 4.5.16 first, as I suspected it would have issues running in PHP 7.2+.

Instead, I installed WP version 5.5.1, running in PHP 7.4. I copied in my theme and uploads files, connected it to my old database (via wp-config.php), and ran it. WordPress detected the old database and updated it automatically. I have not reviewed the updates, but the site seems to be working well.

3
  • Typically, updating code works fine. You can run few tuneup utility plugins to tweak and tidy up the installation. – Lenin Oct 15 '20 at 17:33
  • @Lenin Is there any particular tuneup utility plugin that you recommend? – Ben Miller - Remember Monica Oct 15 '20 at 17:50
  • 1
    WP Clear Cache for me and there are few other optimize utilities. Check with rating and comments before installing them. You can install Snippets plugin to keep the site clean from junky scripts here and there. – Lenin Oct 15 '20 at 17:58
0

It all depends on how important the content is. Assuming you want to save the content, I'd:

  • backup the database
  • backup the settings file
  • backup the themes and plugins folder
  • make sure you can login as admin
  • update to latest WP version
  • update to PHP 7.2+
  • update all themes
  • update all plugins
  • check for any more updates, update accordingly

It's possible that a WP or theme update might bork the site; maybe a theme or plugin incompatibility when you update other things. You might change to one of the 'twenty' themes first before you start updating. You might also need to disable plugins (not delete).

You may also want to research the current theme and plugins to make sure they are compatible with latest WP versions.

After updating, change credentials everywhere (admin users, database, hosting, etc) with strong passwords.

2
  • Sorry, I must not have explained myself very well. I have updated my question with more details. I have backups for everything and cannot log into the site on the old server anymore. I want to know if I should install WP Core 4.5.16 first on the new server and then update, or if I can install WP Core 5.5.1 right away with my old database. The themes and plugins I will take care of myself separately. – Ben Miller - Remember Monica Oct 13 '20 at 22:57
  • If you are taking the old database to use on the new server, then I would install the WP version that the old database last used. Then update WP, as there might be some database updates that need to be done (just guessing). If the new server has the latest PHP, there might be some PHP compatibility issues, don't know. If all you need is the content, then install old WP/old database, export everything. Then install new instance of new WP (fresh install), and import the old database. Make sure you know the old admin credentials, or how to manually fix after the import. – Rick Hellewell Oct 14 '20 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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