So I hade to move en megent site from topunder.se to test.topunder.se this is so that you can test and try new stuff on a site that is not you primary site.
Moving magneto was some hazzel it not as easy as other site is take som sql to make it work.
<VirtualHost *:80> ServerAdmin webmaster@test.topunder.se ServerName test.topunder.se ServerAlias test.topunder.se# Indexes + Directory Root. DirectoryIndex index.html DocumentRoot /var/www/test.topunder.se/# Logfiles ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined </VirtualHost>
CREATE database test_topunder_se;REATE USER 'top_test'@'localhost' IDENTIFIED BY 'top_test_pass';
GRANT ALL PRIVILEGES ON test_topunder_se.* TO 'top_test'@'localhost'; flush privileges;
cp -r topunder.se/ test.topunder.se
Change the database setting in the new copy of the site
vi test.topunder.se/app/etc/local.xml
<connection> <host><![CDATA[localhost]]></host> <username><![CDATA[test_top]]></username> <password><![CDATA[test_top_pass]]></password> <dbname><![CDATA[test_topunder_se]]></dbname> <initStatements><![CDATA[SET NAMES utf8]]> <model><![CDATA[mysql4]]> <type><![CDATA[pdo_mysql]]></type> <pdoType><![CDATA[]]></pdoType> <active>1</active> </connection>
Now lets fill the database with some stuff. First we will dumpt the old and and make some change then reloadet inte the new database.
mysqldump -u root -p topunder > /topunder.sql <--- dump the live database sed -i 's/topunder\.se/test\.topunder\.se/g' /topunder.sql <-- replace topunder.se with test.topunder.se ELSE SITE WILL NOT WORK mysql -u root -p test_topunder_se < /topunder.sql <--- insert the new data in the new database
Done Done !!