
…after a long absence
i am glad to have successfully restored my blog from an aged laptop to Amazon EC2 🙂
would like to save some of the steps I had to follow in order to restore this old site from a Debian installed WordPress and old MySQLÂ to an Ubuntu LAMP server. I managed to migrate the content and plugins from Debian install to now this standard WordPress install with latest MySQL
- using Ubuntu 14.4 on AWS EC2 – Free Tier
- installed apache2, php, mysql and phpmyadmin (apt-get)
- created the .conf files in /etc/apache2/sites-available folder and then published them in /sites-enabled using a2ensite command
- created the respective folders in /var/www/html/ for each site on this server
- only needed apachae conf file for www.azeem.online and used the following code in standard index.html for redirections from all other domains pointed to this host
Add the following lines to index.html
<html>
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.azeem.online">
</head>
</html>
Save the file and restart the web server.(Note:Â Replace DNS_NAME_SERVER with the actual website name. - download the latest WordPress in your home folder“sudo wget http://wordpress.org/latest.tar.gz”
and unpack with
“tar xzvf latest.tar.gz” - move this to the folder location at the “/var/www/html/” path
- install the required extra packages“sudo apt-get install php5-gd libssh2-php”
- using mysql command line do the following:
mysql -u root -p
CREATE DATABASE wordpress;
CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost;
FLUSH PRIVILEGES;
exit
- change folder to the wordpress folder in /var/www/html/ and run following commandscp wp-config-sample.php wp-config.php
- edit this file and find + replace the following information which you have from creation of the database
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');/** MySQL database username */
define('DB_USER', 'wordpressuser');/** MySQL database password */
define('DB_PASSWORD', 'password'); - visit the URL and finish the WordPress install in few steps. Once it’s done I got a fresh install of standard WordPress and it’s database
- unpacked the old site folder in /tmp and replace the new WordPress wp-content folder with the one from old backup. That is the only folder I needed. It should bring back all site content and plugins etc.
- change permissions on the wordpress folder to secure it
sudo chown -R www-data:www-data *
- load and login to ‘phpmyadmin’ in browser and click on the ‘wordpress’ database created earlier
- import the previously backed up wordpress sql database into this database
- click on “wp-options” table and change the URL to new ‘www.azeem.online’
- load the site in browser and login to /wp-admin. It prompted me to update the database which worked smoothly
- Using the ‘Settings’ -> ‘General’ menu check and update if needed the URLs to be the new ones
- Updated all the plugins and WordPress components and
VOILA!!! 🙂