This writeup is somewhat dated. The main migration information is located around here. The Migrate module handles sophisticated transitions. The Backup & Migrate module can help perform basic site moves with optimized database dumps.
For older Drupal sites start with Moving entire Drupal site with databases.
This might help too: Backing Up Your Database
One approach for moving a Drupal 5.x site
I know the "official" process is to load the "tar" file to the host and unpack it. As an alternative, one can copy the code directly from your test site on your PC. I've tried uploading code from my machine twice with disastrous effects. (Okay, so I was born blonde!) So, I've worked out my own process that works. [By the way, this also reduces the bandwidth usage for those who might be running short on that.]
What has always worked for me is to install Drupal with cPanel/Fantastico (I know there are some people out here who will speak ill of Fantastico, but it has always done me right). Now, to be fair, one needs to understand what Fantastico can and cannot do.
Fantastico only supports core functions. It does not support custom themes, contributed modules, or custom code (outside of content). Fantastico does not use "update.php" (as a matter of fact, doesn't even load it), so it is not a good idea to use it to upgrade your installation. As long as you understand this, you're much less likely to have problems.
Make sure that the correct versions of modules and themes are working on your test site.
Here's my process: (by the way, this should pretty much work for changing hosts as well)
- Keep a pencil and paper handy to write down what changes you have to make. You can use this if you need to restart, or to think about changes to your site that slow down moving to new releases.
- Use phpMyAdmin (on some hosts, it's hidden under MySql) to back up your live database. If you have a site that is actively receiving new content, you may have to put the site into maintenance mode to prevent losing new content.
- It would also be a good idea to back up your test database, just in case...
- Import the database into your test site.
- Download any pictures you've uploaded and any folders that are created by the modules you have installed.
- If your live site and test site are not at the same version, you will need to run "update.php."
- Open your browser to your test site. Don't panic if everything looks strange, or even blank.
- In the URL bar, append "update.php" and press Enter. If it says you don't have the access rights, don't worry.
- Using Notepad or similar text editor, open "update.php".
- Near the top, you will see:
// Enforce access checking? $access_check = TRUE;
- Change it to
FALSE
and save it. - Try "update.php" again.
- If you have any errors listed, search the Drupal site for fixes. There's a good chance that someone else has had the problem. If it appears to be a new error, post a request for help. Take your site out of maintenance mode and plan to start over when it's fixed.
- Change
$access_check
back to TRUE. - If you had a custom theme, you probably need to re-enable it for the site to look right.
- Now check out all your module settings. They'll probably be okay.
- Look through your content, especially the front page. Make sure your menus are correct.
- Check out any content that uses custom code, especially if you are changing Drupal versions.
- Does everything check out? Good, you've done all the real work. Now the easy(er) part.
Administer>>Site Configuration>>Themes
and enable it. [Hint: Do not panic if your site looks weird at first. Remember you can always login with http://www.mywebsite.com/?q=user
(yes, "user," not your ID.]update.php
script to your server. I don't know why they leave it out, other than they don't use it. You may need it later.
Comments
Demonstration Site
The Demonstration Site module allows you to create complete database snapshots of the site. The Demonstration Site Install Profile will allow you to make use of these snapshots from install.php.
Multi Site Success
Thank you for you guidance. I am getting things going well from it.
Perhaps others could benefit also from my good luck. I read this whole page and many of the comments at Moving entire Drupal site with databases. From those comments I followed advice to
Then packed the whole local drupal directory with .zip. Uploaded to remote server and unpacked. First time around for me with cPanel > Files on the remote server. You browse to your archive and right click and unpack. Next exported local dBases then imported them into remote dBase from phpMyadmin. Edited all sites settings.php files to match remote dBase and user:password names. The site is working great. Bought a second domain name for now, "Parked" it at the same drupal site and have multisites working.
Moving to new server
I failed to transfer the whole website to another server.
1. I have installed new installation
2. I have upload images and files
3. Mysql redused double by importing all files from old site which were installed automatically (drpl_...)
4. I didn't see content, the result: I should do all content (pages) again (copy-paste)
As I am experienced with Joomla: by importing Mysql, the all website appears at once
So I need to do Drupal website again !
Moving complete site
the process of moving a complete site is simple. I do it about once a week.
tar zcvf {drupal-dir} {archive-name}.tgz
mysqldump -u {db-user} {db-name} -p > {archive-name}.sql
tar zxvf {archive-name}.tgz
chown -R {user}:{group} {drupal-dir}
mysql .... -p < {archive-name}.sql
done
could you more in details
* settings.php - I did
* "create the archives:" - where, how? I export MySQL - isn't enough?
* how to dump data base?
* remote host - what it means ? and so.on :-(
Please help me
settings.php: create a
settings.php:
see line: $db_url = 'mysql://username:password@localhost/databasename';
Dump database: As explained type
mysqldump -u {db-user} {db-name} -p > {archive-name}.sql
the switch "-p" means you will be queried for the password
Fill in your db-user and db-name. Redirect output to YOUR file {archive}.sql
Remote host:
The server to which you want to migrate the installation
Moving to new server
Sorry, but your codes are not clear to me:
"
cd {drupal}/sites
mkdir {your.domain.name}
cp -p default/default.settings.php {your.domain.name}/settings.php
if needed: chown -R ... {your.domain.name}
"
1. I did a copy of default.settings.php and renamed settings.php
2. I have edited new setings of MySql in 2 lines
Where to do this? Where to type?????
"
mysqldump -u {db-user} {db-name} -p > {archive-name}.sql
the switch "-p" means you will be queried for the password
Fill in your db-user and db-name. Redirect output to YOUR file {archive}.sql
"
????
importing MySql
1. I have imported MySql from original website but by upating I keep having many errors like this for css and js:
warning: unlink(sites/default/files/css/3777033de653b310c7590f23912dab87.css) [function.unlink]: Permission denied in /home/anre/domains/anre.lt/public_html/elena/includes/file.inc on line 459.
How update database manually, I don't know
2. Another question: I had clean Drupal installation on the new website. The old installation was done automatically from Elefante free scripts. My sql became now imported with all tables which begins drpl_
So, now I have doubles tables. Is it good ?
Is it Ok move Drupal in this case?
Beata to migrate the
Beata
to migrate the installation you have to do two or three things:
In details:
There was NO hint to do a fresh DRUPAL installation on the new server. DON'T DO IT!
If you do a fresh install and afterwards migrate an existing installation to this server/database then databases/files might be mixed up!
That seems to be the case in your situation.
Reset the database (drop ALL tables) and do an import from your dump/export.
Erase ALL files of the new installation (will be migrated from old server!).
It's much more easy than you expected. No preparations on the new server have to be done.
When there is a table prefix defined - like drpl_ - on your old installation then this is also declared somewhere in the settings.php file. Just take a copy of the old settings.php and modify if to access the new database. Nothing else is needed.
Conclusion for your migration:
* Don't make a fresh install on the new server
* just import your dump to the new database
* copy all files
* adjust settings.php
Regards
no installation
Thank you, I will try it, but I think that it would be better to do everything again from null
That is surprise for me, - to import MySql without installation !
Really I tried this also, after installation I have deleted all tables and than imported MySql, but got errors
What happenned else today ! I have exceeded MySql quota in original server by activating some module, I tried to delete something in MySql but of course I have damaged MySql
As you advised I have deleted all tables in my original (first) server and tried to import MySql which I backuped in April (the same server, the same MySql ) and got errors:
many errors (by indicating compression automatically, gziped), later when I tried to import bzip I got only one error but can't define it in MySql:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-5' at line 1
I don't find this error and I can't even restore my old website :-(
Beata I'm really sad to read
Beata
I'm really sad to read that you got no success. And what I wanted you to do is to erase all tables from the NEW server so the database is clean before importing the tables.
What kind of database export/dump do you have? Is it a text file holding a lot of sql commands to set up tables and import rows? Then it must be possible to import it again. When the dump is compressed you probably have to expand (uncompress) it before importing. Do you use the command line or some tool to import the dump? And of course the dump and the backup of your drupal system / files must be from the same date. Are these conditions fulfilled?
By the way: Importing a database from a dump creates all tables and inserts all rows. So an import from a (complete) dump IS half of an installation. The other half is to restore the files.
Regards
Please, for further questions contact me by email.
thank you for care
Today i am going to upload all installation files to new place (third server) and do Drupal website again from null. I have in my second server all files (http://www.anre.lt/elena/), thefore I can copy-paste to the third server. Maybe I will try to import some MySql from the first server which I have saved before this happened on my first server but I already don't believe a success.
I will try to answer all your questions:
Usually I export MySql in zipped text file and import also zipped. I do it by indicating automatically. There are four options to import: automatically, no compression, gziped and bzip. Yesterday as I wrote, only the last gave me one error but I didn't know how to improve this. All tables has been deleted before it.
Today I tried to import MySql unzipped by indicating "no compression". I failed and got this:
SELECT USER();
What it is?
You wrote: "And of course the dump and the backup of your drupal system / files must be from the same date". In this case I am on the first server and want only to restore previuos MySql
Today I tried again to restore MySql in my first server tring all methods and only the last gave me the same error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-5' at line 1
How to improve it, I don't find
So I leave my first server without restoring, this is free hosting with 10 Mb Mysql
although I have installed Drupal again, because there was many errors although all tables has been erased
http://www.vambutai.eu/elena/
As for moving to second server (something already works but there are many errors when I am trying to update and don't know how to improve them http://www.anre.lt/elena/). This is done by successfully importing MySql from first server, but the files didn't appeared and I did everything manually)
Please explain me: "the dump and backup", what it is ? What do you mean? Do you mean that I have put all Drupal files on new server by copying from old? - when I move to second server ? - please answer.
Sorry, I am not English speaker...
I put new installation files and of course a little higher version. Is this isn't OK?
I import MySql and I am waiting that everything will find their places (all files like in Joomla)
Thefore I thing I need to start again in the third server :-)
hello dear friends i have
hello dear friends
i have installed a drupal commons on a local lampp and now i want to port it over to the webserver. is this very vrery difficult?
what do i need to take care - which lines in the settings.php have to be edited.
greeetings unleash