Upgrade Guide
/home/vito/storage folder and the .env file for VPS installations and the
volumes for the docker
installations.Upgrading to 3.x from 2.x
Upgrade Docker Installation
2.x tag, You need to change it to 3.x or latest tag.3.x tag is the latest code on the 3.x branch, which might not be stable yet, but it will be soon.latest tag is the latest release of VitoDeploy from the 3.x branch, which is stable and recommended for production
use.latest.APP_URL environment variable set to your Vito URL, otherwise, some features like Vito Logs won't work properly.Upgrade VPS Installation
You can upgrade your Vito instance from 2.x to 3.x in Automatic or Manual mode.
Automatic Upgrade
vito user:bash <(curl -Ls https://raw.githubusercontent.com/vitodeploy/vito/3.x/scripts/upgrade-2x-to-3x.sh)Manual Upgrade
vito and continue the steps:Go to the root of the project:
cd /home/vito/vitoDiscard all the possible changes to the code base:
git stashFix any possible ownership change to the code base:
sudo chown -R vito:vito /home/vito/vitoInstall PHP 8.4:
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt install -y php8.4 php8.4-fpm php8.4-mbstring php8.4-mcrypt php8.4-gd php8.4-xml php8.4-curl php8.4-gettext php8.4-zip php8.4-bcmath php8.4-soap php8.4-redis php8.4-sqlite3 php8.4-intl
sudo sed -i "s/www-data/vito/g" /etc/php/8.4/fpm/pool.d/www.conf
sudo service php8.4-fpm enable
sudo service php8.4-fpm start
sudo apt install -y php8.4-ssh2
sudo service php8.4-fpm restart
sudo sed -i "s/memory_limit = .*/memory_limit = 1G/" /etc/php/8.4/fpm/php.ini
sudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 1G/" /etc/php/8.4/fpm/php.ini
sudo sed -i "s/post_max_size = .*/post_max_size = 1G/" /etc/php/8.4/fpm/php.iniInstall Redis:
Vito version 3.x uses Redis for caching, sessions, and queues. You need to install Redis server on your VPS.
sudo apt install redis-server -y
sudo service redis enable
sudo service redis startInstall Node.js:
Vito v3 uses Inertia.js, which requires Node.js to be installed.
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejsAdjust the Nginx configuration:
Set php-fpm to use PHP 8.4 instead of PHP 8.2 by running the following command:
sudo sed -i "s/php8.2-fpm.sock/php8.4-fpm.sock/g" /etc/nginx/sites-available/vito/etc/nginx/sites-available/vito as well: location ~ \.php$ {
...
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
...
}You can run this command instead
sudo sed -i '/location ~ \\\.php\$ {/a \ fastcgi_buffers 16 16k;\n fastcgi_buffer_size 32k;' /etc/nginx/sites-available/vito/etc/nginx/sites-available/vitoclient_max_body_size./etc/nginx/sites-available/vito and add client_max_body_size 100M; line inside the server block.This increase is necessary to allow you to export and import larger Vito settings.
server {
...
client_max_body_size 100M;
...
}Then restart Nginx:
sudo service nginx restartUpdate supervisor configuration
/etc/supervisor/conf.d/worker.conf file to use Horizon instead of the worker.sudo sed -i 's/command=php \/home\/vito\/vito\/artisan queue:work --sleep=3 --backoff=0 --queue=default,ssh,ssh-long --timeout=3600 --tries=1/command=php \/home\/vito\/vito\/artisan horizon/' /etc/supervisor/conf.d/worker.confcommand to:command=php /home/vito/vito/artisan horizonThen restart the supervisor:
sudo service supervisor restartPull the latest changes:
git fetchSwitch to the 3.x branch:
git checkout 3.xRun the update script:
bash scripts/update.shUpgrade failed?
If the upgrade (automatic or manual) failed, follow these steps to fix it:
- Install a new Vito instance
- Copy the
.envfile from the old instance backup to the new instance. - Copy the
storagefolder from the old instance backup to the new instance. - Run
bash scripts/update.shon the new instance to apply the changes.
Upgrade Local installation
If you're using Laravel Sail, you need to kill the current container and delete its images and then boot sail up again.
3.x branch.REDIS_HOST=redis environment variable in your .env file.