Community & Support

seamless switchover to drupal from my old site structure

i currently have an active ecommerce site which i hobbled together myself. i am going to migrate this activity over to my shiny new drupal site, once i get it all set up and tweaked to do everything i need.

my question is, where / how should i proceed with the drupal installation and build up prior to the switch from my current site structure? seo is not a huge issue as i mostly have links to the index page and a couple specific pages that i can rewrite the url's anyhow. what i want to be able to do is go offline for maybe an hour, switch around a few settings, and go back online with a minimum of downtime. any advice on how to do this?

thanks!!
arb

Comments

(no title)

Do you mean that you want to import or update content in those two hours?? Or just switch the domain name to the new site which you already have in a subdomain?

....

This depends on your existing server setup. Do you already have the prerequisites? If you already have a database and php setup correctly, you can develop your site locally... Then when you are ready move it online and do a 'restore' on your web server. Doing it this way, unless you have a very large site should be fairly quick.

You can use Path module to set URL Aliases for your content links to match your existing structure even... Or just drop the .html / .php / etc page extensions now and let Google find it all again.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

what are the pros and cons

what are the pros and cons with regard to this?

ideally, i would build up

ideally, i would build up the site on my live server in a sub folder and then just move it up to the main folder (after deleting the old site) when it's ready.

what i'm worried about is a) screwing up my current site while i'm building up the drupal installation or b) screwing up the new drupal installation when i move it up to the main folder.

in particular, both sites are heavily reliant on .htaccess and on files, includes etc. that fall outside the normal installation. i want to have the new site humming along and fully tested on the live server and then just make the switch.

i've never done anything like this before so and i don't know how drupal will react if i just stick the whole site in a new folder.

(no title)

If that new folder is accessed as a subdomain (http://sub.example.com) which doesn't contain a subdirectory path then the move of the development site to the web root will be very smooth. Otherwise file and image links in the content may need correction.

okay... so i guess subdomain

okay...

so i guess subdomain (http://newsite.example.com), rather than subfolder (http://example.com/newsite/) is the way to go then? just copy and paste to root folder when i'm ready to make the switch? (with i suppose some special care to the .htaccess file). that simple?

(no title)

Normally, not even a change in .htaccess.

There is a $base_url setting in the settings.php file which would need changing, but that setting is optional.

Also, if you put the settings.php file not in the sites/default directory but in a sites/newsite.example.com directory that would need changing, but that is optional too.

So, possibly no change at all anywhere, except if you have manually entered any full URLs for http://newsite.example.com in the content.

Thanks for your kind help cog.rusty. I have set up my trial site @ http://newsite.example.com. Set up was a breaze, as was setting up the db & subdomain, as well as adding modules & such has been easy. I love how I don't have to tweak each page to make site wide changes!

Now I have a question on moving the site to http://example.com to replace the original html site. You are saying as long as there are no absolute links, I could just drag the entire drupal site from the subdomain folder to the full domain folder?

Can you elaborate on how we would do that besides just dragging it over, and what would have to be moved with it. I am slightly technical, and can follow instructions.

Thanks again...
cwinkler

(no title)

Assuming your main site is in public_html,

either

cd [blah]/public_html
cp -r newsite/* .
cp newsite/.htaccess .
rm -r newsite

or else just point your main domain name to drupal's directory if your cpanel allows that.

You can test the copy operation by copying to another subdomain if you want. For extra caution you could empty ("truncate") the database tables whose name starts with "cache" before moving, and perhaps the sessions table.

About internal site links entered into the content:

<img src="http://newsite.example.com/files/image.jpg"> would work, but obviously it would need changing in the new site, either with a database operation or by editing the database dump with a text editor.

<img src="/files/image.jpg"> is the right way. It works anywhere without any problem. (It would need altering too if your base url contained a subdirectory.)

<img src="files/image.jpg"> (a relative link) wouldn't work when using Clean URLs, because when you are, for example, on "/node/65" the browser would interpret it as "/node/65/files/image.jpg" which is wrong of course.

thanks all for these helpful

thanks all for these helpful comments!

Interesting. Keep us posted

Interesting. Keep us posted

You are awesome!

Thanks so much for your help. Let's see how it goes & thanks for the correct way to label an image.

Best to you!

the non-techie version?

Two things:
1) I really want a seamless switchover myself. I currently have a web site up which I need to switch over to Drupal, but which I can't really afford to remove while I create the Drupal version.
2) I'm very much a non-techie. I learn by doing (forging ahead, really), so my basic knowledge tends to be spotty - at best - in some areas.

Basically, I need the dumbed-down version of 1) where to set up Drupal (whether online or on my computer, whichever one is easier/possible :-p ); and 2) how to change over from my old web site to the new Drupal one without any links or pathways getting messed up in the process.

You might feel like this question's been answered already... but, again, I'm really not a techie! I don't know how to create an FTP account for a new subdomain (drupal.[mywebsite].com), and I'm not sure what changes I'd have to make after setting up the new Drupal web page on my computer/in a subdomain.

What I HAVE done:
1) By meandering around, I've been able to create a MySQL databse for Drupal.
2) I've downloaded and extracted the Drupal files into a folder on my computer.
3) I've made a subdomain: drupal.[mywebsite].com
4) I have SmartFTP and I know how to use it. (I'm dangerous!) Except, I'm not sure how to set up FTP access to a subdomain.

Helpful (?) info:
- My web page uses CPanelX for admin purposes, if that helps at all.
- The person who originally made my web site for me (and then went off to college, which is why I need Drupal and why I'm doing this by myself here!) created two SQL databases, and most of the site has PHP stuff going on.

Thanks VERY much in advance for your help,
~Ethan

(no title)

Well... if you want to keep things as simple as you say, then go straight for the host. A local installation would need (a) setting up some server software and (b) a few possible surprises during transfer because of differences between the servers.

If you have set up a subdomain at sub.example.com, then chances are (99%) that you have now a new subdirectory under public_html/sub. That's where your new site is. You can FTP as usual and see that subdirectory. Whatever you put there will be accessed from your subdomain.

So, go ahead and
1. Upload the whole Drupal directory tree into that subdirectory (Not in a sub/Drupal-5.2 sub-sub-directory! Straight into sub)

2. if you have already created the (empty) database in your cpanel, then
- create also a "database user"
- grant to that user access to the database
- grant to that user *all privileges* for the database (create, insert, lock... whatever).
I can't explain this better because every cpanel is different. But these three options must be somewhere in there.

Except if that was already set up as well. But in that case would know the user name and password for the database.

Anyway, take note of your database name, database user name, and passwords, you need them for the final step.

3. Then go to http://sub.example.com and Drupal's installer should fire up. It will ask you about the database, then it will install itself and ask you to create the first user (the super-admin), and you are set. If there is any trouble we'll be around.

I think I understand/have

I think I understand/have figure out everything except for two things, which I'd like to make sure I understand before I go to the Drupal setup:

1) My subdomain user for http://sub.example.com is listed as "example_sub," despite the fact that I specified "sub" as the username. When I input this info to Drupal during the setup, should I use "sub" or "example_sub"?

2) Once I'm finished creating the web site as I want it to look, how will I make the switch from http://sub.example.com to www.example.com ?

Thanks!
~Ethan

(no title)

1. Yes, add "example_" to your database name and username. Hosts do that so that users don't run out of available names.

2. You will move all files and directories which are now under sub back to where your main site is. Normally no other change at all will be needed.

Gah!

So I went to sub.example.com... and got this right away:

"The following error must be resolved before you can continue the installation process:
The Drupal installer requires write permissions to ./sites/default/settings.php during the installation process."

I was so sure I had done everything right! :(

I have an SQL database set up (sub.example.com), with a full-permission user added to it (example_sub).

Edit: If it helps at all to know this - my CPanel allows me to change permissions on specific directories; permissions are right now set to the following:

/public_html:
Read: User, Group
Write: User, Group
Execute: User, Group

/public_html/sub:
Read: User, Group, World
Write: User
Execute: User, Group, World

I'm not sure what the problem might be, or if this info helps :-/

(no title)

That is natural and you are on the right path. Normally your files don't allow writing, but now Drupal needs to write your settings,

Find the setting.php file under [sub]/sites/default, right click with your FTP program and change its permissions to 666.

Then go on with the installation again.

Aaand, something else :-p

Edit: AHA! I did it! The guy who had done my web site before had been using a different password so he could remember it, which I forgot about.

Voila, merci, and if I run into any other obstacles, I'll be sure to 1) try to figure 'em out, and then 2) ask, if I can't. You've been incredibly helpful :)

Cog, I know I am entering

Cog, I know I am entering this conversation pretty late! One small doubt (a big one for me, though)...Once I transfer the files form sub.example.com to example.com, how do i carry out content transfer? Or should all the content be uploaded only in the new live site?
Thanks in advance.
Jaya

jaya

You mean the posts which are

You mean the posts which are in the database? It depends on what you want to do.

If the example.com domain is on the same server as dev.example.com and you want to use the same database, then edit the settings.php file of the example.com site and enter the same database information as before in the the $db_url line.

If you have created a new database for the example.com site, then empty it, take a backup of the dev database using phpmyadmin, and load it in the new database.