Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

Dtupal - Moving a site

I have created a basic site from watching a training video on Drupal. I have created it on my Windows 7 PC using the Acquia Drupal Stack.

I have a host with Drupal set up & a basic site I created there too.

How can I "move" what I did on my PC to the host so I can show it to someone else? I want to save what I already have there too., not overwrite with this.

If you need me to upload any files so you can see things, please specify which.

Thanks
Avatar of Aaron Feledy
Aaron Feledy
Flag of United States of America image

You'll need to go to phpMyAdmin on you local machine and export your database to a file. You'll then need to go to your hosting control panel and create a new database, then import your database file into this new database, likely with phpMyAdmin.

Then create a new folder on your hosting. Upload all of the files from your local Drupal site to the folder. You'll need to edit the file /sites/default/settings.php before you upload it so that the info is for the database you created rather than your local machine.

Now you should be able to visit yoursite.com/yourfolder to view the site.
Install the module called BackUp and Migrate on your local site, enable it and go to it and make a backup. Then on the webhost, upload all the Drupal files with the modules and theme, create a database with hopefully the same name as the one you are using for your local Drupal installation.
Then you have two options. If you are okay with database administration, you can add all the tables from the backup to the database you created
or
you can do a fresh install on the new site, go through all the steps again, enable the BackUp and Migrate module and then do a restore from the backup you made on the local site.

http://drupal.org/project/backup_migrate
Avatar of Richard Korts

ASKER

To Arrow_1,

The only issue I see is I don't know where the drupal stuff is on my local machine.

See attached. I see a folder at the root of C: called 2trees. Is that where it is?
If that's where you configured it to be... Drupal has folders like "includes" "sites" "themes" and some others. You'll also have files like CHANGELOG.txt, index.php and several others. If you see that stuff, then that 2trees folder is your Drupal installation. All of those files and folders need to go into your new folder on the server.
In the search programs and files (on your computer)  look for the name of a file that is always included in a drupal installation, like settings.php or, there is a file in the includes folder called
common.inc
When you find that, you will be in the Drupal installation
Are you using WAMP or XAMPP as your computer web server? Or something else?
To Arrow_1,

I'm trying to use your method.

There is a folder called sites/default. Within it there is a default.settings.php. I guessed that was what you were referring to. It is 95% commented out. There is no reference to the database with the name we are using. The only thing close is this php statement:
$databases = array();

The name $databases is not referenced anywhere else in that script.

Not sure what to do.
$base_url = 'http://2trees:8082';
To Arrow_1,

I did find the following in settings.php under the folder with the site name.

Don;t know how to change this to work on the server.

//D6 DB config
$db_url = 'mysqli://drupaluser@127.0.0.1:33066/2trees';

//D7 DB config
$databases = array('default' => array('default' => array(
    'driver' => 'mysql',
    'database' => '2trees',
    'username' => 'drupaluser',
    'password' => '',
    'host' => '127.0.0.1',
    'port' => 33066 )));
To: nanharbison

I installed the backup / restore module.You say "go to it". I don;t know what that means.

Bear with me, I am just trying to learn Drupal.

I went to config & got the attached. No clue what to do.

Thanks
backup.jpg
Oh sorry! Click on the backup now button to make a backup. And then save that download to a file somewhere on your computer where you can find it easily, maybe on your desktop
If you do a clean install on the host after creating a database with a user name and password, then Drupal will fill out the settings.php file for you. Then you just have to enable the Backup and Migrate module and then go to the configuration page and click on the migrate tab. Or does it say restore?
To nanharbison,

Sorry to be such a dummy.

See attached. I clicked "Quick Backup" after specifying a "private" directory. It put an .htaccess file into that folder, that's all.

So I'm not doing it right.
backup1.jpg
To nanharbison,

You'd think they could make this slightly more intuitive.
Yes, they could make Drupal slightly more intuitive! It took me months to get to the point where I could use it without spending ridiculous amounts of time looking for what I needed to do.
In the image you showed of the backup and migrate, it defaulted to Download the file, so I thought you would just leave that. If you created a private file, it's in the Drupal files on your localhost, somewhere like sites/default/files/backup/private, or someplace like this. It might be better if you just download the file.
Have you found the Drupal files on your computer? I am in the process of downloading the Acquia drupal stack to figure out where it puts the files.
Yes, I found the drupal files.

They are at c:\2trees

2trees is the site name.

I use Lynda.com for training; I think the class is called Drupal Essentials.

The terminology is mind blowing. Node? Module? Content Type?

Come on!
You get used to it and it even starts to make sense. I now create content types to do specific things, it make Drupal so incredibly powerful. You can create a content type so that only certain users can see that content, for example. How are coming getting the site moved over? Are you replacing the basic site you already set up on your webhosting?
nanharbison

I wanted to have several drupal sites at that specific host so I could have a development area.

I can't find the database backup. There is no such folder as this: sites/default/files/backup/private

I didn't choose download; it's already downloaded. Don't know what that means. I'll try it.

I have a mySql backup of the database that I created as a .sql file. Why can't I use that?

Are you available to do Drupal work on a contract basis? I might need that kind of help, I have a REAL project coming up.

Thanks
The download should be wherever your browser puts downloaded files, or maybe it should have asked you where you want to save it?
But you should be able to use the .sql file you have.

There is a way to have multiple Drupal sites from one installation, but I haven't gone down that path yet. When I was reading about it, it seemed really complicated. But I live in the Boston area, where there is a huge Drupal community that meets once a month and I can go ask questions if I have them in the "lightning round". I also go to the annual Drupal Con, the summer convention in Boston.

Yes, I am available for contract work.
nanharbison,

OK, I think I see what to do, EXCEPT for one thing.

In settings.php, it now says this regarding the database:

//D7 DB config
$databases = array('default' => array('default' => array(
    'driver' => 'mysql',
    'database' => '2trees',
    'username' => 'drupaluser',
    'password' => '',
    'host' => '127.0.0.1',
    'port' => 33066 )));

I'm not sure what to do about host & port on the web host.

I guess I could look at the drupal site I already have there & see what those are.

Can you send me an email address where we can have a private conversation about prices, etc. for contract work?

Thanks,

rkorts
The host is whatever your database location is on your webhost. You should be able to ask them. Leave the port blank:
     'port' => '',

The host in your code above is just your own computer.
You could look at what is on your other Drupal site, but not necessarily for the host. On my webhost, every database has a different host address.

nan@ladyslipperwebs.com
Hi nanharbison,

I moved everything up; I loaded all the drupal files & I created the database.

I edited the settings.php file to point to the right database.

FYI, I am an experienced php & MySQL developer.

I went to the right place in a browser; rkassoc.org/2trees.

I get the attached.

This implies to me that it (Drupal) thinks it's doing a brand new install; something is not connected right.

Thoughts?
OH! You are experienced with all this. I didn't realize that. You didn't attach the image so I don't see it. Did you import the files to the new database?
nanharbison,

Sorry, it's attached.

I uploaded the save database (from phpmyadmin) into the web server database.

I uploaded the entire directory from the site on my PC to the server.

Something is wrong.
install.JPG
What webhost are you using? Some use localhost and Godaddy, for example, uses something complicated for the host.
And you left the port blank?
And you changed the name of the file to setting.php instead of default.settings.php?
It seems like it doesn't see the database.
I'm using a webhost in Chicago called ChiHost; they are small and VERY responsive. I was turned on to them about 5 years ago by another EE expert.

I took the settings.php from the other site hosted there & updated settings.php in this site to be similar. Here are the code lines: (password dummied out):

$databases = array('default' => array('default' => array(
    'driver' => 'mysql',
    'database' => 'rkassoc_2trees',
    'username' => 'rkassoc_druser',
    'password' => '<password>',
    'host' => 'localhost',
    'port' => '' )));

I'm 99% that the database name & username are right. I'm NOT so sure about the password. Is there a way to find that in the database or a php program?

I'm thinking maybe I should trash all that's there (and the database) & do the Backup / Restore like you said. I'll try the backup as "Download".

Thanks
To Arrow_1

I wound up doing EXACTLY what you said to do in your very first response.

I edited the settings.php file.

I just get the drupal setup page when I go to open the site.
Something must be wrong in your settings.php file. Try deleting it then go to your site. You will get the setup page. Work your way through it as if you were installing a new site. It will ask you for your database credentials. Put them in and click continue. If your database info was correct, it will warn you that Drupal is already installed. Click "View your existing site" and it should come up.
If you have access to a control panel with this webhost, you should be able to reset the password to your database, and possibly the user name as well
If you do the backup and restore, the database has to be emptied first, probably you know that!
To all,

The web host (who is VERY customer support oriented) reset my database password. It now shows correctly but the theme is missing as well as the photo I had with one article.

I attach two images. The one called "local" is how it looks on my Win 7 PC (using Acquia Drupal Stack). The one called "server" is how it looks on the web server.

Any ideas?
sitelocal.JPG
siteserver.JPG
go into Appearance and make sure your theme is enabled
And did you create any custom CSS? If so, did that file get uploaded and does it show up in your list of style sheets?
SOLUTION
Avatar of nanharbison
nanharbison
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To all:

(1) The theme is Bartik, it is enabled, in fact the colors show correctly in the settings for that theme.

(2) There was NO custom CSS. I would have NO clue how to even start that (in Drupal)
To all,

There is also a missing image.

Where does Drupal put the images connected with the site? Are they in the database or do (did) I have to upload it separately?

Thanks
Drupal puts the images in:
/sites/all/default/files
or
/sites/all/default/files/images
To nanharbison

That path does not exist (on either my local machine OR the server).

Closest I could find is attached (where it put the logo & the favicon).
file-path.jpg
You do need to upload the images, but if you uploaded your entire Drupal site from your computer, wouldn't they already be in place?
If you added an image and put it in a folder of your choice, then you have to put the image there.
Wow, I have never had Drupal do that to me, put the name of the site in the path to the files folder. That must be an Acquia thing!
I wonder if the fact that you did this site with the Acquia installation means things are not where the average Drupalista would look for them.
So I'm sort of getting the message that this Acquia thing does NOT function the same as "real" Drupal?

I can get the image & reupload it; I have no clue how to turn the theme on.

I uploaded EVERYTHING in the top level folder on my machine.

Seems the lesson here is "develop Dtupal where is will eventually be, cause it CANNOT be moved".

That seems a severe limitation.
How can I turn on the Theme?
To all,

I am about to give up on this EE post. You have both tried to help me, I will award points based on effort.

It seems a pretty limited thing for a product not to allow something being moved from one machine to another.

I posted an issue of the "Drupal Forum".

Do either of you have any other suggestions?

Seems like I have to create a new site & start over; I cannot get it to let me fix the Theme.

Thanks
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To Arrow_1,

That looks & sounds very logical, I will try it tomorrow or Monday at the latest.

Thanks
Definitely, the Acquia installation has made changes to the typical Drupal installation. This is NOT Drupal being limiting. I move sites from the production location to the final location all the time and have never had a problem.
I don't know why I couldn't download and install the Acquia exe file. It just sat there and didn't do anything. So I can't test it.
To Arrow_1,

It WORKS!!

Thanks
Very complex to move an Acquia Drupal Stack site from a PC to a web host.