Skip to content

Migration from v1

CAUTION

Before performing the update, create a backup of the files and the database. In case of rollback or error we can help you if you have these files.

INFO

If you prefer, we can do the updating for you. Contact us and we will give you more information.

Before update

Please note that user roles and settings cannot be migrated, you will have to re-add the settings from the control panel once updated.

We strongly recommend making a backup of all files (including hidden files) and the database with all the structure and data.

Disable user password cast

Edit app/Models/User.php and comment the line 47. With this, users can be migrated while maintaining the current password.

php
protected $casts = [
    // 'password' => 'hashed',
    'user_role_id' => 'int',
    'email_verified_at' => 'datetime',
];

Upload files

  1. Create a copy of the .env file.
  2. Delete all files from the previous version and replace them with the new ones, the hidden files must also be replaced.
How to see hidden files

cPanel

  • Login to cPanel as the cPanel user.
  • Click on the "File Manager" icon.
  • Click on the "Settings" button in the upper right corner.
  • Check the "Show Hidden Files (dotfiles)" checkbox.
  • Click the "Save" button.

Plesk

  1. Click on Settings in the top right.
  2. Check that Show system files and directories is ticked and click Save.

MacOS

  • Click the Finder icon in your dock to open Finder.
  • Open Mac Finder to start revealing hidden files on your Mac.
  • Navigate to the folder where you want to find hidden files.
  • Press Command + Shift + . (the period key). This will show hidden files in the folder.
  • To hide the files again, press Command + Shift + . again.

Windows 11

  • Open File Explorer from the taskbar.
  • Select View > Show > Hidden items.

Windows 10

  • Open File Explorer from the taskbar.
  • Select View > Options > Change folder and search options.
  • Select the View tab and, in Advanced settings, select Show hidden files, folders, and drives and OK.

Ubuntu

  • Go to that folder and either press the menu button in the top-right corner of the window and select Show Hidden Files, or press Ctrl+H.
  1. Once all the files have been replaced, open the original copy of the .env file and update the new uploaded file by updating the following variables with the previous data.
env
DB_CONNECTION=******
DB_HOST=******
DB_PORT=******
DB_DATABASE=******
DB_USERNAME=******
DB_PASSWORD=******
  1. Update APP_URL variable from .env file, you have to put the main URL of the application.
env
APP_DEBUG=true
APP_URL=https://getlaralink.com

LOG_CHANNEL=stack
  1. Follow the installation instructions for the configuration files (prepare files and server), but do not run the wizard or the manual installation.

Run database migration

Once everything has been prepared and the files updated, the database structure must be updated.

Access the root of the application through the terminal, and run the migration command.

sh
php artisan update:database

If you do not have access to the terminal, you can contact us and we will tell you what options there are depending on your control panel.

Finish migration

Once the migration is complete, all that remains is to activate the user password hash again.

Edit app/Models/User.php and uncomment the line 47.

php
protected $casts = [
    'password' => 'hashed',
    'user_role_id' => 'int',
    'email_verified_at' => 'datetime',
];

Now enter the database and for the root administrator user, modify the is_root column and set the value 1, this user will have root permissions.

Now with this user access the administration panel and reapply the previous configuration.