WordPress Updates
I had a very old computer (running FC3), hosting some very old wordpress blogs that got broken into. The good news is that I had backups of all the blogs. But since the computer was still working, though not allowed to be online, I could also copy the data directly from that computer. I ended up copying data from both places to get the blogs back up. Here’s what I did.
- Register a cname for the old computer name with a new computer.
- Set up a virtual host for this cname, using the same directory structure as on the old computer.
If I were starting over, I’d probably use a different scheme, but I don’t want to break any links that other people have to us. So things will stay the same. - Download the latest version of WordPress and make a copy for each blog.
- Edit the wp-config.php file with the info from the old blogs.
- Create a mysql database and grant the privileges for the correct user.
mysql> create database alpha1; Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on alpha1.* to alpha_user@localhost identified by 'amazing_password'; Query OK, 0 rows affected (0.00 sec) mysql> quit
- Load the old sql dump into this new database.
$ mysql -u alpha_user -p alpha1 < 2014-11-18-alpha1.sql
I got the sql file from doing a mysqldump, which I use for backups.
- Copy the old uploads directory from backup to the new wordpress location and make sure everything is owned by apache:apache.
I had another problem that I needed to address with these blogs. They all used https for access. On the computer I moved them to, https was already being used by another website I was running. Since most of these blogs are no longer being updated, just read, I decided to not use https for anything. This did require that I temporarily set up https for the blogs. Then I logged in, upgraded the database, edited the settings to use http instead of https. Lastly, I installed a plugin called search and replace. I used this to change the links for all the uploads from starting with https to http.
That’s it.