Moving Drupal Installs

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
vhannon's picture

Hey all, as I mentioned last night at the LA Drupal group I'm trying to move a Drupal install from a Windows XP box to a Linux box (Fedora Core 8). I'm working in the command line and I've done a mysqldump to a .sql file which I then move to the Fedora box. Both are running the same version of MySQL but as soon as I load the data into the database I get 404 errors when I try to hit the site.

As many of you mentioned last night there should be no issue in moving a database. I'm sure I'm doing something else wrong.

Thanks in advance for any thoughts.

Vaughn

Comments

If you're getting 404 errors

christefano's picture

If you're getting 404 errors then the problem is at the web server level, not the database. Did you migrate all of your files, too, including Drupal's .htaccess file? If you have Clean URLs turned on, are you sure that your Linux server is set up to support them?

Yup, Apache/.htaccess

Chris Charlton's picture

It's most definitely either your .htaccess file is missing or is not being respected by Apache. This is a somewhat common issue when migrating.

First, double check you have the .htaccess file in the drupal root.

Second, check if Apache has mod_rewrite ON (this can be done via shell or phpinfo).

Third, check if Apache is set to respect domains' own .htaccess rules. (Apache's httpd.conf)

Chris Charlton, Author & Drupal Community Leader, Enterprise Level Consultant

I teach you how to build Drupal Themes http://tinyurl.com/theme-drupal and provide add-on software at http://xtnd.us

Aha!

vhannon's picture

Ok, sorted it out and that last thing was a bit of help. Apache was set to 'AllowOverride None' for .htaccess and we changed that to 'AllowOverride All'

Now we're up an running.

Thanks all!

V

I hear an echo in here. ;)

christefano's picture

I hear an echo in here. ;)

moving webites from winxp to linux environment

ppokah0111's picture

I get only the first page and everything is broken links, but on my winxp it's all good. I also checked if my .htaccess was carried along and it was fine. what can I do

It sounds like you have URLs

christefano's picture

It sounds like you have URLs or paths to images in the 'files' table of your database that should be updated to reflect your new server environment.

find & replace

mike stewart's picture

to build on this idea, because its a common situation, using a SQL dump file and a text editor, its to do a text "find & replace" to find the old path, and replace with the new path. after the find and replace, just import the "fixed" database file.

or just using SQL you could accomplishing this using: UPDATE files SET filepath = REPLACE(filepath,'path/to/search','path/to/replace'); . always have a backup!

paths can be stored in more than just the files table too! for instance if you need to move a module, which is a good practice if you find you need to customize it. anyway, hope it helps someone!

--
mike stewart { twitter: @MediaDoneRight | IRC nick: mike stewart }

Nice, thanks for the follow

christefano's picture

Nice, thanks for the follow up.

There's also a Search and Replace Scanner module but I haven't tried it and it appears to only work on content (title, body and CCK fields) and not the files table.

Search and Replace Scanner

jromine's picture

I've used Search and Replace Scanner module to update embedded links (in content) on a site that moved, and I highly recommend it.

John Romine