Post by DaveBunny » Mon Aug 04, 2008 5:30 pm

I have installed opencart locally whilst I have been developing it. However the time has come to upload to my host. The problem is that my host can't rename the database names that they assign which obviously don't match the tables I set up locally.

Any ideas?

Apologies if there is a really simple answer to this.

Thanks

Dave

New member

Posts

Joined
Mon Jul 14, 2008 7:32 pm

Post by bruce » Mon Aug 04, 2008 7:31 pm

Hi Dave,

You can upload all the local files to the location of your choice on the web server and...

either
  • run the installer and tell it the new database name and database username/password combination
  • enter all your products again and upload all the images etc
or
  • edit your config files to "point" the store to the new file system / url combination and also the database name and database username/password combination.
  • export your local database using mysql and import it into the new database name on the server using the same file
hope this helps

Bruce

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Qphoria » Mon Aug 04, 2008 8:20 pm

Dave,

I assume you mean that you are using a dbname like "opencart" and your host wants to prefix your sitename like "davesite_opencart"

Can't you just upload everything, import your sql and then rename the dbname in the config.php and admin/config.php? You shouldn't have to do a reinstall.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by DaveBunny » Mon Aug 04, 2008 9:06 pm

Qphoria wrote: Dave,

I assume you mean that you are using a dbname like "opencart" and your host wants to prefix your sitename like "davesite_opencart"

Can't you just upload everything, import your sql and then rename the dbname in the config.php and admin/config.php? You shouldn't have to do a reinstall.
Thanks to both of you so far...

My host assigns a name relating to my domain e.g. kitchencab_db1. So if I change the db name and password in my config files, it will work on my host. And as well, if I change my db name and password locally to match I will be able to continue editing using localhost?

Thanks again

Dave

New member

Posts

Joined
Mon Jul 14, 2008 7:32 pm

Post by Qphoria » Mon Aug 04, 2008 9:10 pm

Yes.

If you want to have the same files on both local and remote, and not have to change the config files each time, then yea you can change your local db to the same name/user/pass and it will work seamlessly.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by DaveBunny » Tue Aug 05, 2008 5:02 pm

Qphoria wrote: Yes.

If you want to have the same files on both local and remote, and not have to change the config files each time, then yea you can change your local db to the same name/user/pass and it will work seamlessly.
what about the URL's in the config files? They would have to be changed each time still wouldn't they?

Thanks for you input.

Dave

New member

Posts

Joined
Mon Jul 14, 2008 7:32 pm

Post by Qphoria » Tue Aug 05, 2008 6:10 pm

urls would of course. You can't have your cake and eat it :)

But at least the database stuff would be the same because localhost would be relative to the server you are on.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by hm2k » Tue Aug 05, 2008 10:11 pm

You could do if statements to workout what the URLs should be, but this depends on your level of understanding of PHP.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by Qphoria » Tue Aug 05, 2008 10:15 pm

hm2k wrote: You could do if statements to workout what the URLs should be, but this depends on your level of understanding of PHP.
True, but how complex do we want to make this. You could probably even do the logic right in the config.php file (in fact you'd probably have to since they are define constants). But I think just uploading all files except the configs and you should be ok.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 2 guests