Magento Forum

   
Page 1 of 3
How to move Magento store from Localhost to Webhost
 
ukdazza
Guru
 
Total Posts:  308
Joined:  2008-04-16
 

I have made a magento store on my pc using xampp localhost but I now want to put it onto my hosting.

I have installed magento on my hosting but now what? I think I have to import my database stuff but I am not sure how to go about doing it? Do I have to make a database with my hosting (I have) and then export from localhost and import to webhost? I tried that and it said something about the user failing.

Do the users need to be set the same on both databases?

This is probably a simple question, I just don’t know what I am doing lol

 
Magento Community Magento Community
Magento Community
Magento Community
 
AnnaM
Guru
 
Avatar
Total Posts:  325
Joined:  2008-01-29
San Francisco
 
ukdazza - 08 June 2008 06:20 AM

I have made a magento store on my pc using xampp localhost but I now want to put it onto my hosting.

I have installed magento on my hosting but now what? I think I have to import my database stuff but I am not sure how to go about doing it? Do I have to make a database with my hosting (I have) and then export from localhost and import to webhost? I tried that and it said something about the user failing.

Do the users need to be set the same on both databases?

This is probably a simple question, I just don’t know what I am doing lol

Create a database on your server, call it whatever you want.  On your pc, using some utility (never worked with mysql on PCs so don’t know what) you need to dump the database to a file, lets call that file dumpfrompc.sql

Then on your server, using PhpMyAdmin, open the new db you created, click Import, and point it to that file on your pc. It will then import the database. 

To tell magento to use that db on the sever, go to app/etc/local.xml and fil in the database name, root, and mysql root password.  I have put “removed” in mine, but it shows you where to put db name and root password.  If you don’t have phpmyadmin, the db can also be “undumped” from ssh command line, ie imported to your new db after you upload the dumped file.

mysqldump -Q --opt -u root -p newlycreated_db < dumpfromPC.sql

<default_setup>
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[root]]></username>
<password><![CDATA[removed]]></password>
<dbname><![CDATA[newlycreated_db ]]></dbname>
<active>1</active>
</connection>
</default_setup>

Whether or not you can simpley upload whatyou have on your pc to the server is a question for somebody else. I doubt it myself and think you will have to install magento fresh and tell it to connect to the database created/imported discused above, but not sure.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mihaidoru
Jr. Member
 
Total Posts:  2
Joined:  2008-06-09
 

I am in the same situation: want to move the local script + DB to a dedicated machine.

1. I saw that the DB credentials are saved in an XML file: app/etc/local.xml. You need to modify them for the new host.
2. I also saw that URLs are saved in the DB: table core_config_data. You need to modify them to point to the new URL.

After modifying the two above, I still cannot login into the Admin. Session file is created, from the SQLs sent to the MySQL Server I see that the login info is validated ( first selects for the ‘admin’ user and then selects it’s ‘user_roles’).

The Frontend seems to work.

Any further help would be appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cooper
Sr. Member
 
Total Posts:  104
Joined:  2008-03-31
 

Just an idea :

clean :  var/cache

 
Magento Community Magento Community
Magento Community
Magento Community
 
mihaidoru
Jr. Member
 
Total Posts:  2
Joined:  2008-06-09
 

Already did that. No change.

[On the login page]
Strange thing is: if I insert the real credentials for Admin, it just redirects to the same login page.
If I insert dummy data, it throws the error: “Access Denied.”

Thx.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Actually all you need to do is delete local.xml and run the installer again - it won’t overwrite your db.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ukdazza
Guru
 
Total Posts:  308
Joined:  2008-04-16
 

riiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiite. well I am a noob and dnt have a clue what has been said lol

 
Magento Community Magento Community
Magento Community
Magento Community
 
ukdazza
Guru
 
Total Posts:  308
Joined:  2008-04-16
 

easier to just make it again? Not done loads, only categories and stuff....I don’t fully understand as I did an “export” and then an “import” and it said that there was a problem with the permissions. Do the users and passwords have to be the same?!

“#1044 - Access denied for user.....[DETAILS OF USER]”

Also, what’s with deleting the random files. Surely there should be a cleaner way to move a Magento shop?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 
ukdazza - 10 June 2008 03:50 AM

Also, what’s with deleting the random files. Surely there should be a cleaner way to move a Magento shop?

Actually what I was referring to was reinstalling it: http://www.magentocommerce.com/boards/viewthread/901/

This might help you: http://www.magentocommerce.com/boards/viewthread/4279

There are actually several threads on it in the forum if you search around.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 
ukdazza - 10 June 2008 03:50 AM

Do the users and passwords have to be the same?!

Yes.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ukdazza
Guru
 
Total Posts:  308
Joined:  2008-04-16
 
sherrie - 10 June 2008 04:55 AM

ukdazza - 10 June 2008 03:50 AM
Do the users and passwords have to be the same?!

Yes.

Aha. This will be where I am going wrong. Can I simply add an user to the database and it will recognise it or do the admin accounts have to be the same user and password?

-database doesn’t have to be called the same thing does it? as they are called magento but online my cost puts the server name clangame in front of it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ukdazza
Guru
 
Total Posts:  308
Joined:  2008-04-16
 

....sorry. but how are the users going to be the same? one is called clangame_admin and the other is god knows what...admin maybe....how do I change or add a user to the local install?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

The database name and password is what needs to be the same if all you’re doing is moving files, BUT there is a way without them being the same - do you still have access to your original database?

Are you using phpMyAdmin?

If so this will be really simple, just open phpMyAdmin and then click on the name of your database on the left.  Then click the export tab - all of the tables in it should be selected by default - then save the export.

Then you create a new database, go into phpMyAdmin, click on the name of the new database, click on the import tab, and import the file you just exported. 

After that, the easiest way I’ve found is to install the Magento package and tell it the name/password of your new database.  Once you’re done installing, just upload any files you had changed before as well as your theme(s) and your media folder (product images).

All your settings should be the same as your old location as they are stored in the database.

There could be a way with fewer steps - but for me that was the way with the least amount of headaches.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ukdazza
Guru
 
Total Posts:  308
Joined:  2008-04-16
 

aha. thanks! i will do this, makes the most sense. so how do I uninstall magento from my server (in order to re-install it)?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

If you want to reinstall it, all you have to do is delete app/etc/local.xml and visit your website again - it will automatically pull up the installation screen.

smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
ukdazza
Guru
 
Total Posts:  308
Joined:  2008-04-16
 

done. i didnt have much live in the other store, but what sort of things would i need to move (folder wise) to the new one? media you said...anything else you reckon?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 3