• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

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
0
Richard Korts
Asked:
Richard Korts
  • 23
  • 21
  • 4
2 Solutions
 
Aaron FeledyDrupal Developer and ConsultantCommented:
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.
0
 
nanharbisonCommented:
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
0
 
Richard KortsAuthor Commented:
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?
0
Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

 
Aaron FeledyDrupal Developer and ConsultantCommented:
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.
0
 
nanharbisonCommented:
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
0
 
nanharbisonCommented:
Are you using WAMP or XAMPP as your computer web server? Or something else?
0
 
Richard KortsAuthor Commented:
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.
0
 
Richard KortsAuthor Commented:
$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 )));
0
 
Richard KortsAuthor Commented:
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
0
 
nanharbisonCommented:
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
0
 
nanharbisonCommented:
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?
0
 
Richard KortsAuthor Commented:
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
0
 
Richard KortsAuthor Commented:
To nanharbison,

You'd think they could make this slightly more intuitive.
0
 
nanharbisonCommented:
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.
0
 
Richard KortsAuthor Commented:
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!
0
 
nanharbisonCommented:
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?
0
 
Richard KortsAuthor Commented:
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
0
 
nanharbisonCommented:
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.
0
 
Richard KortsAuthor Commented:
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
0
 
nanharbisonCommented:
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
0
 
Richard KortsAuthor Commented:
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?
0
 
nanharbisonCommented:
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?
0
 
Richard KortsAuthor Commented:
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
0
 
nanharbisonCommented:
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.
0
 
Richard KortsAuthor Commented:
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
0
 
Richard KortsAuthor Commented:
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.
0
 
Aaron FeledyDrupal Developer and ConsultantCommented:
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.
0
 
nanharbisonCommented:
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
0
 
nanharbisonCommented:
If you do the backup and restore, the database has to be emptied first, probably you know that!
0
 
Richard KortsAuthor Commented:
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
0
 
nanharbisonCommented:
go into Appearance and make sure your theme is enabled
0
 
nanharbisonCommented:
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?
0
 
nanharbisonCommented:
Do you know how to change the order of the tabs and put Home before About?
Structure -> Menus-> Main Menu (if that is the correct menu) then grab the cross on the left with the mouse and change the order and save the page
0
 
Richard KortsAuthor Commented:
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)
0
 
Richard KortsAuthor Commented:
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
0
 
nanharbisonCommented:
Drupal puts the images in:
/sites/all/default/files
or
/sites/all/default/files/images
0
 
Richard KortsAuthor Commented:
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
0
 
nanharbisonCommented:
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.
0
 
nanharbisonCommented:
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!
0
 
nanharbisonCommented:
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.
0
 
Richard KortsAuthor Commented:
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.
0
 
Richard KortsAuthor Commented:
How can I turn on the Theme?
0
 
Richard KortsAuthor Commented:
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
0
 
Aaron FeledyDrupal Developer and ConsultantCommented:
Normally the process I described is all it takes to migrate a site. I do it several times a week. What seems to be different here is the Acquia stack. It appears that the Acquia stack configures what's called a multi-site configuration. When that happens, your "default" site is empty which is normally not the case. This means we need to take a slightly different approach to migrating this site.

The process for copying the database is the same. The process for copying the files is the same. This time though, you'll want to edit the settings.php file in the /sites/2trees folder to match your database settings. There should be no settings.php file located in /sites/default.

Now we need to adjust the multi-site configuration so that your 2trees site becomes the default. With the mult-site configuration, drupal takes the path of the URL into account when deciding where the files are located. We'll need to override that by editing a file. Check under the sites folder for a file called sites.php. If it doesn't exist, copy example.sites.php to a new file called sites.php. You'll now want to edit this file to reflect your server configuration. What we want to change are the aliasing settings near the bottom of the file. All lines should be commented out. Only one uncommented line should be at the very bottom of the file:
$sites['example.com.2trees'] = '2trees';
Change example.com with your domain name. This will cause the site to use the files in sites/2trees when the url is example.com/2trees.

Hopefully that makes some sense. This is normally not how things are done. It seems acquia has complicated things just a bit.
0
 
Richard KortsAuthor Commented:
To Arrow_1,

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

Thanks
0
 
nanharbisonCommented:
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.
0
 
Richard KortsAuthor Commented:
To Arrow_1,

It WORKS!!

Thanks
0
 
Richard KortsAuthor Commented:
Very complex to move an Acquia Drupal Stack site from a PC to a web host.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 23
  • 21
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now