Sunday, December 27, 2015

WordPress Migration - Moving WordPress to Another Server

Moving wordpress to a New Amazon EC2 Server in  . 
If you are moving WordPress from one server to another, begin by backing up your WordPress directory, images, plugins, and other files on your site as well as the database. See WordPress Backups and Backing Up Your Database.
Keeping Your Domain Name and URLs
Moving your domain without changing the Home and Site URLs of your WordPress site is very simple, and in most cases can be done by moving the files.

If database and URL remain the same, you can move by just copying your files and database.
If database name or user changes, edit wp-config.php to have the correct values.
If you want to test before you switch, you must temporarily change "siteurl" and "home" in the database table "wp_options" (through phpMyAdmin or similar).
If you had any kind of rewrites (permalinks) setup you must disable .htaccess and reconfigure permalinks when it goes live.
Changing Your Domain Name and URLs
Moving a website and changing your domain name or URLs (i.e. from http://example.com/site to http://example.com, or http://example.com to http://example.net) requires the following steps - in sequence.

Download your existing site files.
Export your database - go in to mySQL and export the database.
Move the backed up files and database into a new folder - somewhere safe - this is your site backup.
Log in to the site you want to move and go to Settings > General, then change the URLs. (ie from http://example.com/ to http://example.net ) - save the settings and expect to see a 404 page.
Download your site files again.
Export the database again.
Edit wp-config.php with the new server's mySQL database name, user and password.
Upload the files.
Import the database on the new server.
Also, manually review all the wp_x_options tables and look for three fields and edit them as needed:

home
siteurl
fileupload_url
After moved to another server Permlinks are not working in ec2.

. After moved to another server we need to change alloverride none to alloverride all to apache2.conf as well as your virtualhost that is your  website.conf
.enable rewrite mode in apache use this command
sudo a2enmod rewrite
sudo service apache2 restart
.delete the content of old .htaccess file and paste the new code
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

.give 644 or 777 permission for .htaccess file in wordpress.
.then change the permlinks default to custom and save .

IT SHOULD WORK.

Article By www.ScriptoGraphics.com . A Magento eCommerce Web Development Company

No comments:

Post a Comment