hi, i've been workin on a drupal installation, and i have the main website installed in htdocs, and now i need to create a duplicate of the website, so i thought about:

- creating a new database and then import the original one to the new one
- copy a new drupal 6 installation into htdocs/2ndwebsite
- copy the new default.settings.php to settings.php and redirect the new database
-copy all the modules, themes from htdocs/sites to htdocs/2ndwebsite/sites/all

now if i open www.mywebsite.com/2ndwebsite, i can see the exact theme as www.mywebsite.com (and that is correct i guess), but i can't access to any link, because any of them shows www.mywebsite.com/user, and not www.mywebsite.com/2ndwebsite/user.

what is wrong with what i've done?

Comments

stokks’s picture

really anybody can help me with this? It's making me freak out

mmomtcheva’s picture

Modify the RewriteBase if you are using Drupal in a subdirectory and the rewrite rules are not working properly.
For example if your site is at http://example.com/drupal uncomment and
modify the following line:
# RewriteBase /drupal in file .htaccess

stokks’s picture

i modified the .htaccess in htdocs/2ndwebsite/

with RewriteBase /2ndwebsite but it's still not working, it says "page not found" (while showing the correct theme).

How can i figure this out?

mmomtcheva’s picture

In settings.php uncomment

$base_url = 'https://www.mywebsite.com/2ndwebsite';

stokks’s picture

i've already done that, but still doesn't load any page, actually any link i have on the new page redirects to www.mywebsite.com/user (for example), instead of www.mywebsite.com/2ndwebsite

maybe the problem is that i have my htdocs organized like this:

-includes
-modules
-sites
-themes
-2ndwebsite (and inside drupal installation, i mean -includes, - modules, -sites)
-.htaccess
-index.php etc

is it organized well? or shall i change it?

mmomtcheva’s picture

- create a new database
- copy a new drupal 6 installation into htdocs/2ndwebsite
- fresh install on drupal 6 - www.mywebsite.com/2ndwebsite - same user/password for admin!
- and then import the original database to the new one
- copy only mywebsite.com/sites without old settings.php
- paste into mywebsite.com/2ndwebsite/sites

stokks’s picture

i made the first 3 steps, but when i tried to import the database, i got the 1062 mysql error, so i searched in the internet and i found the solution (it consists on emptying the variables that the fresh drupal installation created, and then import).

now i have the main page with the content and theme uploades, but still if i try to open any link like www.mywebsite.com/2ndwebsite/user i get that page not found (not the white page).

furthermore on top of the page i can only see links to the original website...

any suggestions?

mmomtcheva’s picture

http://www.juliakm.com/how-move-drupal-site-new-host-without-going-crazy
OR:
When I transfer from a development site to a live production site I tend to use the Backup & Migrate module. I would just do a fresh installation on the live site, transfer all the necessary modules and themes and use the backup and migrate tool to transfer over the database, it does the trick for me, the only thing is if you have images you need to copy those over onto the live site.

stokks’s picture

yes, but i can't even get the access as admin... looks like i only have the new (secundary)-home page and the modules somewhere, but nothing works more than that... and it's on apache with windows... what did i do wrong? the .htaccess? the copying of the folders?

what i need is the original to work with old users and contents, and the new one to have others users and content (and possibly modules)

i really have been searching for a solution for a long time... but haven't figured this out

mmomtcheva’s picture

You need "Backup and Migrate" only to make the export. Clear the cache before backup. I suppose the same version of Drupal core is used. If you can do fresh install - the .htaccess is correct.
Save the new settings.php. Continue with copy sites. Replace the old settings.php with the new one and import the backup via PhpMyAdmin.

stokks’s picture

i already tried. what i did this time was
- put the fresh installation folder in htdocs/2ndwebsite

- then create a new database

- localhost/2ndwebsite and do the installing

- copy the modules, and themes folders from htdocs/sites/all to htdocs/2ndwebsite/sites/all

- activate all the modules that were being active in the original website (i may say again that the original installation is online and has to keep on working while i do this), and activate the theme

now comes the problem, from the original website, i make a backup of the database (that with the module is 4 mb, with phpmyadmin was 30 mb), download it, then go to the new website (until this moment i can enter as an admin), and restore it.

when i restore it i get visually the page as the original website, but now i'm not anymore logged in as admin of the new website, but as admin of the old one

still don't now a way to figure this out... if anyone knows a process to do that without going crazy from the beginning, i'd really appreciate ;)

ps: I might remember that it works on apache in windows

mmomtcheva’s picture

This is normal - when you restore the database you restore the old users(admin) but the installation was with the new one. You need to make only the fresh install with the same admin/password.

stokks’s picture

i understand that, but after i restore, i get to the same "new" home page, with the same problems i had before....

maybe there is some module that i shouldn't include in the import of the database? flush the cache from the menu (will this affect the original website?)

mmomtcheva’s picture