Main Menu

search

You are here

Drupal local server management

[last updated: 2024-01-21]
Drupal home page
Drupal - local server:

ddev commands: https://ddev.readthedocs.io/en/latest/users/usage/cli/
-----

On This Page:
  • find site URL
  • find login username and password
  • backup local drupal 10 site
  • if you can't log in...
  • create new user
  • run update.php
  • lessons/problems
  • links

  • Find url of your site:
    In terminal (CLI): be in directory of your ddev project
      My project is named "dev-10", and it's located in a directory of the same name.
      cd to this directory.

    $ ddev describe

      This will return:
      in first row: the url of your local site.
      Enter this url into your browser to visit your site.

    ---------------------------------------------------------

  • Find login username and password:
    when you created your drupal site, usr #1 ("root" user) was created.
    username and password for this user#1 were listed in the terminal when you executed the
    ... command that ...
    You should have copied these down, but if you did not ...
    ---------------------------------------------------------

  • Backup local drupal 10 site:
    • for core, themes, etc, did simple copy of entire dev-10 folder
      and saved to backup folder outside the dev-10 structure
    • for database:
      from: https://drupalize.me/topic/back-your-drupal-site
      from cli in dev-10 folder:
        $ ddev drush sql:dump --gzip --result-file=backup.sql

      file: backup.sql.gz was created in dev-10/web folder

    ---------------------------------------------------------

  • If you get locked out:
    • It happened... that I removed the login block from the site,
      then, later, not thinking it through, logged out...
      and then had no obvious way to log back in...
    • closed site, opened again to:
      https://dev-10.ddev.site/user/login
      Whew!

    ---------------------------------------------------------

  • Create new user:
    When you log into your newly created site for the first time, you shouild:
    create a new user, with your choice of username and password, but wi6h admin privileges,
    for convenient editing of your site.
    ---------------------------------------------------------

  • Run update.php:
    Do this after doing anything with new modules or themes.

    ---------------------------------------------------------

  • Lessons/problems from manually juggling things around:
    • load a new theme:
      from site - appearance, install new theme
      this requires a .tar.gz file (near as I can figure...)
      This will put a new listing on the appearance page as "uninstalled"
      A new folder will be created in web/themes
    • if you "install" (ie. "load") a new theme with composer,
      the new theme directory is created in web/contrib/themes
    • unloading a theme:
      • if you "uninstall" a theme on the appearance page, it goes to the uninstalled section, but is still there.
        I call this being "loaded".
      • If you want to completely "unload" it, ie. remove it from the appearance page,
        you can delete (or move) the theme file from web/themes.
        However it seems that if the theme is "installed" when you do that,
        it confuses something in the config files and gives you errors.

        So you must first uninstall it from the appearance page,
        then you can delete the theme folder,
        then after you clear cache, the theme will be gone from the appearance page

        • if you have deleted or otherwise lost an installed theme,
          and are therefore getting error messages on reports,
          you can create a "dummy" theme of the same name,
          uninstall it on appearance page,
          then after deleting the (dummy) theme folder and clearing cache, the error messages should be gone.
        • from forum:
            "If the .info file is present with the minimum required properties
            (name, type, base theme and core/core_version_requirement)
            then your theme will be visible on your website at Manage > Appearance "

    ---------------------------------------------------------

  • Links: