Moving WordPress

This assumes you have created a LAMP server and it is working correctly

1. copy files using ftp client
2. Make Backup of sql (mysqldump -u root -p [databasename] > Backupfile.sql;)
3. on new server – upload files (/var/www/[sitename])
4. copy sql backup to directory to restore from
5. connect to mysql (mysql -u root -p )
6. create database (CREATE DATABASE databasename;)
7. Create user for database (GRANT ALL PRIVILEGES ON *.* TO ‘username’@’%’ IDENTIFIED BY ‘some_pass’ WITH GRANT OPTION;)
8.restore database (mysql -u root -p [DatabaseName] < SQLBackupFile.sql;) 9. Change permissions on files (using ftp client) - For Directories - chmod 755; - For Files - chmod 644; 10. Change owner on the files (chown [name:group] /var/www/[website] -R) www-data:www-data for me (this is the user running apache2) 11. Edit the wp-config.php file and change the database username, password and database name. (use VI instead of notepad) 12. restart apache2 - (sudo /etc/init.d/apache2 restart) 13. Change dns to point to new server 14. Test Note - i needed to edit the .htaccess file (which I did with VI) Note2 - if you want to change the site name, ie ... from www.site.com to test.site.com you need to change the reference in the sql backup before uploading and restoring Followup: Make sure you add the proper routing to your /etc/apache2/sites-available/default [VirtualHost *:80] ServerName SiteURL.com ServerAlias www.siteURL.com DirectoryIndex index.php (or start page) DocumentRoot /var/www/siteName (from #3 above) [/VirtualHost] Links I used and found some of this stuff: http://www.magentocommerce.com/wiki/groups/227/moving_magento_to_another_server

http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Ubuntu

http://codex.wordpress.org/Moving_WordPress

http://www.debuntu.org/how-to-create-a-mysql-database-and-set-privileges-to-a-user/

Bookmark the permalink.

Comments are closed.