Moving a site to a new server

  • I developed a site locally on my computer.

    When it was done, I

    • exported the database to a sql file,
    • created a new database on the web server
    • imported the sql file
    • copied all files (including .env, etc) to the web server

    The Front end works no problem, but I can't seem to get to the backend. I get a 500 error when it redirects from /backend to /auth/login.

    What have I missed?

    Thanks in advance to anyone that can help.

  • Global Moderator

    Hello, @qualitycoder.

    You should check for apache/nginx logs as 500 errors are coming from misconfigured settings.
    Usually, it's because of different settings on rewrite rules and such.


  • I looked in the laravel.log file (/storage/logs/laravel.log).
    It's saying it can't find the partials.notifications view, but I see it right there in the AdminLTE Theme folder.

    [2017-06-16 07:18:02] local.ERROR: InvalidArgumentException: View [partials.notifications] not found. in /[removed]/www/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:137

    • [site name]
      • Themes
        • Adminlte
          • views
            • partials
              • notifications.blade.php

    I actually get a whole slew of error messages. The top of the file is the missing partials.notifications view file. The last in the file is

    [2017-06-16 07:18:02] local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Uncaught InvalidArgumentException: View [errors.500] not found. in /[removed]/www/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:137

  • admin

    And do those file exist ?

  • alt text
    alt text

  • admin

    Hm that's strange. Maybe it's not trying to get into the adminlte theme ?

    Something must have gone wrong when moving servers.

    How exactly did you perform this ?

    • I built it locally
    • I exported the database to a sql file
    • I created the new database on the server
    • I ran the sql file on the server
    • I ftp'd the files up to their location
    • I checked the front end, and it worked
    • I checked the back end, and it does not work
    • I cleared out the storage/framework/cache, storage/framework/sessions, and storage/framework/views directories, hoping that would help.
    • I came here looking for help

  • admin

    In those steps it looks you like forgot to copy (create) over the .env file.

  • alt text

  • admin

    I can't tell what you forgot with the info you're providing.

    Maybe try the procedure again ?

  • I kind of figured it out.

    For some reason, the /en/auth/login is trying to use the custom front-end theme, and not the adminLT theme.

    I copied the notifications.blade.php and the entire errors theme directory over to my custom theme directory, and it showed a page. Didn't have the login form, but at least I'm starting to show a little progress.

    It didn't do this on my local box, but once it transferred to the server, it wants the auth/login to be part of the custom theme. Weird.

  • admin

    Hm the login views are always in the frontend theme (flatfly by default). So if you have a custom theme, it should always contain those views.

  • I copied the layouts/account.blade.php file to the custom theme layouts directory, and now the form shows up, but after logging in, it redirects me to a blank custom theme page (the custom theme is shown with no content). It doesn't show the back end with the adminlte theme.

  • admin

    It shows a blank page when going to /backend?

  • no, after copying the account.blade.php page over, it redirects to /en/auth/login and shows the login form.

    Once I log in, it redirects me to a blank custom theme page, not the backend. The url is /en, not /backend.

    After that, I can type in /backend again, and it will take me there, but it doesn't take me there on its own.

  • admin

    That's normal.

  • When I use the Flatly theme, after typing in /backend, and being redirected to /en/auth/login, I log in, and it redirects me to /backend.

    With a custom theme, after typing in /backend, and being redirected to /en/auth/login, I log in, and it redirects me to /en. I have to go back to the url bar and type in /backend again.

    This is normal?

  • admin

    No, check your setup as the redirect is using redirect()->intended(). Seems like your issue is fixed then.

Log in to reply

Looks like your connection to AsgardCms was lost, please wait while we try to reconnect.