Upgrading Mixpost Pro to v1 from v0
Sometimes the upgrade can go wrong, so we recommend that you backup your database before starting the upgrade.
Upgrade Using Docker
Upgrading Mixpost using Docker is straightforward. Ensure that you preserve the mounted volume during the process. Simply follow these steps:
Navigate to your folder where you have the docker-compose.yml
the file then run:
# Pull the latest version
docker compose pull
# Stop and remove the old container
docker compose down
# Start a new container
docker compose up -d
If something goes wrong, you can use the inovector/mixpost-pro-team:v0
tag to revert. Also, you need to restore your database backup.
Upgrade in a PHP Environment
This method applies if you have installed Mixpost Pro manually or within an existing Laravel application.
1. Updating your composer.json
using the require
command
composer require inovector/mixpost-pro-team "^1.0"
2. Migrations
Some changes were made to the database, use the migration below to update your database to the latest schema:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Inovector\Mixpost\Models\Account;
return new class extends Migration
{
public function up(): void
{
Schema::table('mixpost_accounts', function (Blueprint $table) {
$table->boolean('authorized')->default(false)->after('data');
});
Account::withoutWorkspace()->update(['authorized' => true]);
Schema::table('mixpost_settings', function (Blueprint $table) {
$table->unique(['user_id', 'name']);
});
Schema::create('mixpost_user_two_factor_auth', function (Blueprint $table) {
$table->id();
$table->bigInteger('user_id')->unsigned()->index();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->text('secret_key');
$table->text('recovery_codes');
$table->timestamp('confirmed_at')->nullable();
$table->timestamps();
});
Schema::create('mixpost_pages', function (Blueprint $table) {
$table->id();
$table->uuid('uuid')->unique();
$table->string('name')->nullable();
$table->string('slug')->unique();
$table->string('meta_title')->nullable();
$table->text('meta_description')->nullable();
$table->string('layout');
$table->boolean('status')->default(0);
$table->timestamps();
});
Schema::create('mixpost_blocks', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('module');
$table->json('content')->nullable();
$table->boolean('status')->default(0);
$table->timestamps();
});
Schema::create('mixpost_page_block', function (Blueprint $table) {
$table->id();
$table->foreignId('page_id')->constrained('mixpost_pages')->onDelete('cascade');
$table->foreignId('block_id')->constrained('mixpost_blocks')->onDelete('cascade');
$table->json('options')->nullable();
$table->integer('sort_order')->nullable();
});
Schema::create('mixpost_configs', function (Blueprint $table) {
$table->id();
$table->string('group');
$table->string('name');
$table->json('payload')->nullable();
$table->unique(['group', 'name']);
});
}
};
Don't know how to migrate?
- Open your terminal and navigate to your project directory.
- Generate a migration file by running:
php artisan make:migration create_mixpost_v1_tables
- Open the new migration file from
database/migrations
and paste the migration code into it. - Apply the migration with:
php artisan migrate
- Done!
3. Config changes
There have been numerous config changes. If you have published the Mixpost config file, you should update it manually.
To update easily, simply run the following command:
php artisan vendor:publish --tag=mixpost-config --force
4. Clear the cache
php artisan route:clear
php artisan view:clear
php artisan mixpost:clear-services-cache
php artisan mixpost:clear-settings-cache
5. Optimize application
php artisan optimize
6. Terminate the Horizon process
php artisan horizon:terminate
Conclusion
Following these steps will ensure that your Mixpost Pro installation is upgraded to v2
, maintaining performance and security standards.