Hi, I'm new in the drupal community, and i'm having problem opening on localhost (wampserver) a site that has been sent to me.
Now when I enter the project I get the message:

Drupal already installed

To start over, you must empty your existing database.
To install to a different database, edit the appropriate settings.php file in the sites folder.
To upgrade an existing installation, proceed to the update script.
View your existing site.

So, I don't know what to do with the database: do you think there is already a database that I can't change for another one? Shall I create a new one? How?
And most important, if I click on update script (the third option) I get the message:

PDOException: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) in drupal_get_installed_schema_version() (line 150 of C:\wamp\www\mir\includes\install.inc).

Can anybody please help me with this?

Comments

jaypan’s picture

What did you do to get to this point?


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
stokks’s picture

I downloaded drupal 7.9, then unzipped the folder in wamp/www directory, then installed drupal on a new project (that was because because I wanted to try to install it for the first time) so I had to enter phpmyadmin to create a new database, and then it simply worked installing drupal.

A few days later my friend sent me this folder with his project (the sites folder, a .backup file, and a projectname-drupalDB file without extension), so I unzipped another drupal7.9 folder to the wamp/www folder, then copied the sites folder which I received (I substituted it to the original one), and tried to open localhost again. Is it ok the way I explained it?

jaypan’s picture

Yes.

This is what I would suggest doing:

1) Get your friend to install the Backup and Migrate module on his site
2) Get your friend to take a database dump of his site using this module and send it to you
3) Create a new empty database in your WAMP setup
4) In the Drupal installation, delete settings.php
5) Copy default.settings.php to settings.php (so you have a new, fresh settings.php
6) Install your new copy of Drupal into the database you created. This will be a new fresh Drupal installation
7) Install the backup and migrate module into this fresh Drupal installation
8) Use the backup and migrate module to import the database dump that your friend sent into the new installation

This is the easiest way to migrate a site.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
stokks’s picture

excuse me, isn't it the database dump the file without extension named "projectname"-drupalDB ?
By installing Drupal at step 6 you mean unzipping a new folder and insert in it my sites folder right?

(sorry for the many questions ;) )

stokks’s picture

i tried to do what you suggested. but after trying to open the project in localhost i get this message

( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\mir\includes\file.inc on line 2031
Call Stack
# Time Memory Function Location
1 0.0151 369336 {main}( ) ..\install.php:0
2 0.0513 831120 install_drupal( ) ..\install.php:26
3 2.4989 8289200 install_run_tasks( ) ..\install.core.inc:79
4 2.5007 8296584 install_run_task( ) ..\install.core.inc:342
5 2.5007 8296584 install_select_profile( ) ..\install.core.inc:473
6 2.8265 9122816 drupal_get_form( ) ..\install.core.inc:1014
7 2.8265 9123616 drupal_build_form( ) ..\form.inc:123
8 2.8266 9125192 drupal_retrieve_form( ) ..\form.inc:329
9 2.8268 9125872 call_user_func_array ( ) ..\form.inc:785
10 2.8268 9126160 install_select_profile_form( ) ..\form.inc:785
11 26.8734 9402136 install_profile_info( ) ..\install.core.inc:1067
12 26.8880 9405216 drupal_required_modules( ) ..\install.inc:1209
13 26.8880 9405440 drupal_system_listing( ) ..\module.inc:839
14 28.3282 9466600 file_scan_directory( ) ..\common.inc:5173
15 29.6742 9478952 file_scan_directory( ) ..\file.inc:2033
16 29.6764 9479912 file_scan_directory( ) ..\file.inc:2033
17 30.1404 9484584 file_scan_directory( ) ..\file.inc:2033
18 30.2393 9485584 file_scan_directory( ) ..\file.inc:2033

Do you know what does this mean? Any suggestions?

stokks’s picture

I don't know how to enter the project in localhost...

jaypan’s picture

You need to bump up the max execution time in your php.ini file.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
stokks’s picture

ok, i changed the maximum execution time in php.ini , and i get the same message, this time for the file common.inc, which is in the /includes folder. so i changed the same limit in that file, but now it returns me that the time limit was exceeded in file.inc file, which doesn't have a function similar to the previous one in it. What shall i do now? Do you think it would be better to work online? In that case what should i do?

jaypan’s picture

As I said, you need to change it in php.ini, not in the individual file itself. Changing it in php.ini changes it for the whole server - all scripts.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
stokks’s picture

here's what i've done now: the php.ini file is in the wamp/bin/php/php5.3.8 folder so i open it with notepad, change the value to

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 600

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = -1

while earlier it was max_execution_time = 30 (now 600) and max_input_time = 60 (now -1 , that is unlimited)

but i still get the same message. did i do something wrong?

jaypan’s picture

You will have to restart the server before those changes are in effect.

If you do restart the server and it doesn't work, then create a file called php.ini in the webroot (or edit the existing one if there is one), and add the following to it:

[php]
max_input_time = -1

Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
stokks’s picture

no, i don't have them now... but look, there is something new, my friend told me:

i haven't used any drupal module to backup, to install it in your pc just create a new database, with the name you need and inside that restore backup files, then you just have to create a new drupal installation and indicate your database with username and password, then copy the "sites" folder in it.

what i don't understand now is how i can create a database (with phpmyadmin or with mysql shell), since i created one with myphpadmin but then it doesn't let me import the database because the dumpfile is too big. So i tried with mysql shell, but i don't know how to do that , because if i write mysql -u username -p
then he asks me a password that i don't know.

What do you think?would you kindly write a step-to-step procedure?

jaypan’s picture

I already wrote you one, and as I explained, it is the easiest method. A direct database to database transfer ends up with errors that are a pain to fix. If you use the module I told you about, you have no errors, and it is really easy.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
stokks’s picture

i made a fresh new installation of drupal (with new database created with myphpadmin), then installed the backup and migrate module, but when it comes to restore the site, i have the same problem that i can only upload a 2M file, while i have a 28M (of database dump).

since i already modified the php.ini file i don't know what to do, since i believe that i still can't copy the sites folder that they sent me instead of fresh one i just installed.

have you got any suggestions?

stokks’s picture

i finally managed to import the database from the dump file (using mysql workbench), but now, when i go to localhost, and try to open the project (which actually is the original drupal installation), i get errors. so i tried to copy the sites folder they gave me, but i get another time the message that i got at the beginning. do you think that backup and migrate could do something more than import the database dump?

jaypan’s picture

Did you import a backup and migrate database dump, or a regular database dump?

Go back and re-read my instructions. Make sure you are using the exact same file system as your friend has (with the exception of the settings.php folder).

If you have done this using backup and migrate, are using the exact same file system as your friend, and are installing the database dump into a clean Drupal installation, then post your errors here.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
jaypan’s picture

You can increase the size of the upload in your php.ini file. Use the following values:
upload_max_filesize = 30M
post_max_size = 30M


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
stokks’s picture

i've restored the database dump with mysql workbench, so now i have it, because the backup and migrate module doesn't work for such a big file (even after changing the php.ini parameters). so i think my next step would be installing a new drupal project, and then i think put instead of the original sites folder, the one they sent me. i've tried that one but it gives me a new kind of error, as the first one.

i don't understand in which exact moment i should exchange the sites folder, because i think that maybe now the database is ok, right?

stokks’s picture

look, this is the message i get after importing the database with mysql workbench, then open localhost, and opening a new drupal installation. more precisely i get the message of a drupal already installed, then i click on "Update script", and get this:

Error
Error message

Notice: Undefined index: zen in _drupal_maintenance_theme() (line 74 of C:\wamp\www\mirodinero\includes\theme.maintenance.inc).
Notice: Trying to get property of non-object in _drupal_theme_initialize() (line 145 of C:\wamp\www\mirodinero\includes\theme.inc).
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mirodinero.blocked_ips' doesn't exist: SELECT 1 FROM {blocked_ips} WHERE ip = :ip; Array ( [:ip] => 127.0.0.1 ) in drupal_is_denied() (line 1847 of C:\wamp\www\mirodinero\includes\bootstrap.inc).
Notice: Trying to get property of non-object in _theme_build_registry() (line 560 of C:\wamp\www\mirodinero\includes\theme.inc).
Notice: Trying to get property of non-object in _theme_build_registry() (line 560 of C:\wamp\www\mirodinero\includes\theme.inc).
Notice: Trying to get property of non-object in _theme_build_registry() (line 560 of C:\wamp\www\mirodinero\includes\theme.inc).
Notice: Undefined index: zen in theme_get_setting() (line 1177 of C:\wamp\www\mirodinero\includes\theme.inc).
Notice: Undefined index: zen in template_preprocess_maintenance_page() (line 2447 of C:\wamp\www\mirodinero\includes\theme.inc).
Notice: Trying to get property of non-object in template_preprocess_maintenance_page() (line 2447 of C:\wamp\www\mirodinero\includes\theme.inc).
Warning: array_keys() expects parameter 1 to be array, null given in template_preprocess_maintenance_page() (line 2450 of C:\wamp\www\mirodinero\includes\theme.inc).
Warning: Invalid argument supplied for foreach() in template_preprocess_maintenance_page() (line 2450 of C:\wamp\www\mirodinero\includes\theme.inc).

The website encountered an unexpected error. Please try again later.

What should i do?

stokks’s picture

I MADE IT! i had to change some values in the settings.php parameters, and .htaccess too. but now i think i made it.
i can view the entire site without errors.

but... but the problem is that i want to update it and make some changes, and if i try to click on update scripts, i get this message:

Access denied

Access denied. You are not authorized to access this page. Please log in as the admin user (the first user you created). If you cannot log in, you will have to edit settings.php to bypass this access check. To do this:

With a text editor find the settings.php file on your system. From the main Drupal directory that you installed all the files into, go to sites/your_site_name if such directory exists, or else to sites/default which applies otherwise.
There is a line inside your settings.php file that says $update_free_access = FALSE;. Change it to $update_free_access = TRUE;.
As soon as the update.php script is done, you must change the settings.php file back to its original form with $update_free_access = FALSE;.
To avoid having this problem in future, remember to log in to your website as the admin user (the user you first created) before you backup your database at the beginning of the update process.

i just tried to do what suggested, but i still get the same message. furthermore, if i try to enter using ?=admin, the button to enter doesn't work (maybe the password is incorrect). Any suggestions?

jaypan’s picture

Backup and migrate database dumps are not the same as a regular database dump, they only come from that module, and will only work with that module.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.