I made a copy of a drupal install, and am trying to move it to another domain. However, the copy is still pointing to the original database, yet I did a a find/replace of all references of the original domain to the new domain in the SQL, and updated settings.php with new domain. I'm thinking that this is a cache problem, but cache is turned off, and I cleared cache before starting the move.

Here is my process:
1. Cache mode is diabled (always has been.
2. I clicked clear cache button in Admin
3. I copied all files from www.domain1.com to www.domain2.com.
4. I opened settings.php on domain2.com, and updated the domain to www.domain2.com
5. I exported the SQL in PHPmyadmin from www.domain1.com.
6. I did a find/replace of all "domain1.com" to "domain2.com".
7. I imported this SQL to "domain2" database (which was blank, fully dropped, before import).

DONE, right? I go to www.domain2.com and everything seems ok, except when I login to Admin, I am back at www.domain1.com.

Any ideas on what I'm missing here?

Thanks much!

Comments

vm’s picture

double check that the $db_url in settings.php is indeed changed. Sometimes the permissions on the file don't allow it to be changed on the sever.

2nd double check base_url also in settings.php and insure that it either points to the new url or is commented out.

also of note would be anything that you may have to manually to .htaccess on the old site and carried over to the new site.

jasonfnorth’s picture

Thanks... here are my results:

>>double check that the $db_url in settings.php is indeed changed.
>>Sometimes the permissions on the file don't allow it to be changed on the sever.

Yes, $db_url = domain2_db

>>2nd double check base_url also in settings.php and insure that it
>>either points to the new url or is commented out.

Yes, $base_url = www.domain2.com

>>also of note would be anything that you may have to manually
>>to .htaccess on the old site and carried over to the new site.

Nope. No .htaccess file carried over.

I'm at a serious loss for what is going on here... wierd huh?? :-)

jasonfnorth’s picture

Another thing weird I noticed is when I right click on any images on the www.domain2.com, they are linked to images on www.domain1.com. I expected that the 400 find/replace of "domain1" to "domain2" which I did in the SQL would have fixed these references, but for some reason Domain2 images are all pointing to Domain1??? What is going on here?! :D

vm’s picture

evidentally you didn't get all of them or didn't get them in the correct table in the DB. I only use relative urls to reference to avoid this kind of situation.

vm’s picture

can you use dirty urls to navigate?
ie: yoursite.com/?q=admin ?

on the old site was clean urls originally enabled?

if so, and you didn't carry over the original .htaccess that could be the problem.
manually navigate to yoursite.com/?q=admin/settings/clean-urls and reenable clean urls, if the dirty ones work.

jasonfnorth’s picture

I get this:
Your system configuration does not currently support Clean URLs. The handbook page on Clean URLs has additional troubleshooting information.

I would have to talk to my host to get modrewrite turned on I think... UGGGH...

There's got to be another solution here. Scratching head...

vm’s picture

so the dirty urls work?

if so, you should go back to your old site. disable clean urls and then export the database with clean urls disabled if they were originally enabled. I don't know where this setting lives in the database. I always turn clean urls off before moving a site in the first place.

otherwise, yes you will need mod_rewrite. Those are your solutions. Clean urls will not work without mod rewrite and if it was indeed enabled on the previous site than that setting is still enabled on the new site in the DB somewhere.

jasonfnorth’s picture

I'm starting to lose my mind. How f'n hard is it to move a Drupal site?! I've done it many times before with no problems, yet everytime I double check my process and go through it again, I login to Domain2.com, and it logs me into Domain1.com?! WTF???

vm’s picture

Obviously, if you've done it before (many times) without issue, than it's likely nothing to do with drupal and more to do with the change of environments.

how I handle moving

disable clean urls
set site offline
clear cache tables (manually)
clear sessions table (manually)
clear watchdog table (manually)

export DB

move files
import DB
alter settings.php

login thorugh site.com/?q=user
navigate to site.com/?q=admin
navigate to clean urls and reenable (provided mod rewrite is available, though I wouldn't use a host where it isn't)
set site back online and check for functionality.

jasonfnorth’s picture

Thanks for that.

I've searched and can't find any clear instructions on how to clear cache manually. Do I just delete these cache tables?

vm’s picture

no you do not delete the tables you empty the contents of the table

jasonfnorth’s picture

Worked. Thanks kazillions my friend!