How to migrate your website on laravel from cpanel to ispconfig

Discussion in 'Installation/Configuration' started by Eduardo Travieso Gonzalez, Jul 22, 2024.

  1. I am recently using ispconfig. Now I have the situation that I need to migrate a website from cpanel made in laravel, which has complicated it a little. I tried several things like migrating only the web page in the public_html folder but obviously it didn't work and I haven't found any tutorial about it that also involves a web page developed in laravel. If anyone could give me any recommendations or suggestions it would be very helpful. Thank you.

    It's my 1st post here so I'll put some more details just in case:
    The website uses php 7.3
    laravel 8
    database in mysql

    I don't know what else could be relevant
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no folder named public_html in ISPConfig. The folder where the website needs to be copied is named "web." You must copy the whole website into the ISPConfig web folder. Your laravel website likely has files outside of the laravel public_html folder, you must copy these files too as your site requires them. Finally, as laravel uses a custom document root, you must specify the custom document root to the laravel public_html folder via apache or nginx directives field in ISPConfig. use the search function of the forum to search for laravel, you should find some hints on that topic.
     
  3. If rather what I'm looking for is the way to migrate those dependent files out of public_html and avoid the 500 error when loading the website, the problem is that in laravel these files I don't know where they are and I also have the problem that I don't have contact with the creator of the website
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You copy the complete site structure as it is incl. public_html folder into the web folder and finally you set the document rot to point to the public_html folder from laravel in ISPConfig. if you need help with the migration of the site, contact ISPConfig business support: https://www.ispconfig.org/get-support/?type=ispconfig
     
  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    From my experience with Flarum, which also uses laravel, basically they are also files and folders below public_html folder, other than what is inside public_html folder, which you also need to copy and put them together inside the web folder.
     
  6. Yes I have tried to do that but I still have the problem "error 500", I already checked that I pointed to the correct database with the correct username and password, also check that I use the same Php version and laravel, but so far nothing, it's like I'm missing some dependency or something
     
  7. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

  8. If I know, my biggest problem is that I have no way to contact the previous creator/administrator of the website and the client is not able to provide me with more information, I also appreciate his help
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    First, disable the custom error pages in the website settings; this might give you a more detailed error message. Then, you should check the error.log file, which is in the website's log folder, to see what exactly is causing the 500 error.
     
  10. Apparently the problem is on line 24 which says the following:
    require __DIR__.'/var/www/clients/client1/web1/web/laravel-8-crud-app/vendor/autoload.php';

    Of course the cumbia yo is rotated with respect to the original chanel server to match the laravel/vendor/autoload folder.php that contains the following and I think is where it does not find the dependency but I can't think how to solve it

    autoload.php shows the following:
    <?php

    // autoload.php @generated by Composer

    require_once __DIR__ . '/composer/autoload_real.php';

    return Composer AUTOLOADERINITD85F71B8E08DB23E35F738E4E1809379::getLoader();
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    This line makes no sense. __DIR__ is the directory of the website, you just added it twice now. Also, migrating your site to ISPConfig does not require code changes in your site unless the old site config contains absolute paths, which is not the case here. You just have to take care to upload all files and folders plus take care that the relative folder structure is kept intact. So change it back to:

    and then take care that you uploaded all files into the site including the composer folder.

    As I mentioned, if you do not know how to upload a site to a new server, you might want to contact business support or ask any web developer who knows laravel based sites.
     
  12. I can fix the migration, thank you
     
  13. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    The autoload file seems to be created by composer, so I think, you need to find a way to enable composer for your web site and run composer install / update for it in there to fix it. Do check that site's software for the right command.
     
  14. Waqas Saeed

    Waqas Saeed Member

    The initial steps to diagnose 500 errors in Laravel:
    you should have enabled the following debugging mode to know the actual error causing the issue;
    APP_DEBUG=true in your .env file & disable 'production' environments.

    Make sure the composer is installed (composer -v you can try that on root also) but do not run the 'composer update' or 'composer self-update' on root! highly not recommended.
    Please ensure that you are using the PHP version similar to the one you migrated from.

    your symlink should be as per follows;
    Code:
    user@server:~/web/public$ ls -al
    lrwxrwxrwx  1 user client4   52 Aug 17 19:42 storage -> /var/www/clients/client4/web6/web/storage/app/public
     
    Last edited: Sep 11, 2024
  15. concept21

    concept21 Active Member

    There should be a backup feature in your Laravel script. Use it and restore them under web root of your new ISPConfig3 web site.
     

Share This Page