{"id":99,"date":"2013-01-21T09:40:50","date_gmt":"2013-01-21T15:40:50","guid":{"rendered":"https:\/\/sysadminnightmare.com\/?p=99"},"modified":"2013-01-21T09:40:50","modified_gmt":"2013-01-21T15:40:50","slug":"moving-wordpress-and-magento","status":"publish","type":"post","link":"https:\/\/sysadminnightmare.com\/index.php\/2013\/01\/21\/moving-wordpress-and-magento\/","title":{"rendered":"Moving WordPress"},"content":{"rendered":"<p>This assumes you have created a LAMP server and it is working correctly<\/p>\n<p>1. copy files using ftp client<br \/>\n2. Make Backup of sql (mysqldump -u root -p [databasename] > Backupfile.sql;)<br \/>\n3. on new server &#8211; upload files (\/var\/www\/[sitename])<br \/>\n4. copy sql backup to directory to restore from<br \/>\n5. connect to mysql (mysql -u root -p <password>)<br \/>\n6. create database (CREATE DATABASE databasename;)<br \/>\n7. Create user for database (GRANT ALL PRIVILEGES ON *.* TO &#8216;username&#8217;@&#8217;%&#8217; IDENTIFIED BY &#8216;some_pass&#8217; WITH GRANT OPTION;)<br \/>\n8.restore database (mysql -u root -p [DatabaseName] < SQLBackupFile.sql;)\n9. Change permissions on files (using ftp client)\n\t- For Directories - chmod 755;\n\t- For Files - chmod 644;\n10. Change owner on the files (chown [name:group] \/var\/www\/[website] -R)  www-data:www-data for me (this is the user running apache2)\n11. Edit the wp-config.php file and change the database username, password and database name. (use VI instead of notepad)\n12. restart apache2 - (sudo \/etc\/init.d\/apache2 restart)\n13. Change dns to point to new server\n14. Test \n\nNote - i needed to edit the .htaccess file (which I did with VI)\nNote2 - 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\n\nFollowup:\nMake sure you add the proper routing to your \/etc\/apache2\/sites-available\/default\n[VirtualHost *:80]\nServerName SiteURL.com\nServerAlias www.siteURL.com\nDirectoryIndex index.php (or start page)\nDocumentRoot \/var\/www\/siteName (from #3 above)\n[\/VirtualHost]\n\nLinks I used and found some of this stuff:\n<a href=\"http:\/\/www.magentocommerce.com\/wiki\/groups\/227\/moving_magento_to_another_server\">http:\/\/www.magentocommerce.com\/wiki\/groups\/227\/moving_magento_to_another_server<\/a><\/p>\n<p><a href=\"http:\/\/www.mediawiki.org\/wiki\/Manual:Running_MediaWiki_on_Ubuntu\">http:\/\/www.mediawiki.org\/wiki\/Manual:Running_MediaWiki_on_Ubuntu<\/a><\/p>\n<p><a href=\"http:\/\/codex.wordpress.org\/Moving_WordPress\">http:\/\/codex.wordpress.org\/Moving_WordPress<\/a><\/p>\n<p><a href=\"http:\/\/www.debuntu.org\/how-to-create-a-mysql-database-and-set-privileges-to-a-user\/\">http:\/\/www.debuntu.org\/how-to-create-a-mysql-database-and-set-privileges-to-a-user\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8211; upload files (\/var\/www\/[sitename]) 4. copy sql backup to directory to restore from 5. connect&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/sysadminnightmare.com\/index.php\/2013\/01\/21\/moving-wordpress-and-magento\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2,9],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-admin","category-web"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2bgeE-1B","_links":{"self":[{"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":0,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sysadminnightmare.com\/index.php\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}