0

I've just gotten a site I'm supposed to do some work on but I'm having trouble with migrating to a local development environment. I don't have admin access to the site itself, but I do have access to the server. I pulled the database down along with the code base, but I seem to have messed up the file permissions when moving the site because the site loads, but not all the functionality is present.

The site isn't accessible beyond the splash page, and none of the image assets load except the site logo. Accessing any menu links generates a 404. The image that loads has the same ownership and permissions as the image which loads which are myuser:www-data and 640. Initially, no images loaded, but following this post about securing file permissions got the logo loaded.

I am also having issues with accessing the site. Since, I can't access any menus beyond the root, it seems that I can't access the login page either. I've added a user for myself with Drush, and even run drush uli with the the URI provided as a parameter, but the link is inaccessible and returns a 404. I also used the File Permissions module, but it doesn't seem to have helped.

At this point, my next step is going to be setting up a clean install and importing the db through backup and migrate and moving the theme and modules manually, but I'd like to figure out what I did wrong and how to avoid this.

3
  • On a Mac it would go cd ~/Sites and then chwon -R myuser:staff my-project/. And as you are locally you could also chmod -R 777 my-project/. But that shouldn't be necessary. Did you doublecheck the .htaccess and uncommented the right RewriteBase directive?
    – leymannx
    Commented Dec 2, 2018 at 10:14
  • Apart from that this question unfortunately is too broad as it would require lots of back and forth clarification in comments. Debugging always needs to be done by you. As we don't know your project, your setup, your machine or you. Good luck!
    – leymannx
    Commented Dec 2, 2018 at 10:16
  • maybe try setting the $base_url in the setting.php file
    – izus
    Commented Dec 2, 2018 at 12:38

1 Answer 1

0

I did recently a manual migration and had some problems, similarly to you. After this, I made a script to manually migrate the site and the database. You need to have a zip with the Drupal installation, not the folder of the installation, just the files inside it, the database and know if the database has some prefix. Change all the prefix in the database, you could use notepad++ or similar to change all in one command. Change the url i.e: mydomain.com/drupal to localhost/drupal. Then import the database, and unzip the files in your localhost server. Then go to sites/default/settings.php and at the bottom of the file edit the data of your database, prefix if you have one, pass, user, port if you changed it and, in same file, look for $settings['update_free_access'] = FALSE; and change it to true. Now, in your browser visit localhost/yourinstallationfoldername/update.php and follow the instructions. If you don't know the users you can see in the database for the table users and you can see there their ID (uid) and password (uuid) on md5. Just search on google for any md5 generator and copy paste it on uid 1 (admin user generated on installation) for know the name of the user you can go to the table users_field_data and look on name column.

If you have a virtual server working on your server, you must remember to point it to the new folder where is your Drupal installation. This is a good tutorial about how to do it: Installing virtual hosts for Drupal sites and subsites.

5
  • in this case, what tripped me up was not replicating the folder structure and improperly specifying the app entry point with a virtual host. If you update your fairly comprehensive answer to include this I'll accept it, since it's good to have the info out there and not in a comment. Thanks.
    – nizz0k
    Commented Feb 6, 2019 at 8:54
  • Edited. I think it explains what you did in your installation. If not, please, tell me. My english, as i said, is not the best, so ill try to write it in an understandable way. Commented Feb 6, 2019 at 9:08
  • perfectly understandable, cheers.
    – nizz0k
    Commented Feb 6, 2019 at 9:50
  • Drupal 8 doesn't use MD5 for hashing the password. Also, the uuid field isn't the password field.
    – avpaderno
    Commented May 15, 2020 at 10:25
  • A bit late, but thank you for your corrections @kiamlaluno Commented Jun 2, 2020 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.