Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix outdated adapter location in Flysystem #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xkzl
Copy link

@xkzl xkzl commented Jan 11, 2023

No description provided.

@nafiesl
Copy link

nafiesl commented Feb 12, 2023

Hi @xkzl, I can confirm that this fix works as expected for the local destination 👍

Here is how I test this PR using laravel 9.x:

Install a new Laravel 9x project (using PHP 8.0)

laravel new backup_manager_test
cd backup_manager_test

Install the package from this PR

Update the composer.json file on the new laravel project to use the forked backup-manager/laravel repositories:

    ...
    "license": "MIT",
    "repositories": [
        {
            "type": "vcs",
            "url":  "https://github.com/nafiesl/backup-manager-laravel"
        },
        {
            "type": "vcs",
            "url":  "https://github.com/xKZL/backup-manager"
        }
    ],
    "require": {
    ...

Install my forked backup-manager/laravel package:

composer require backup-manager/laravel dev-laravel_9_support

Verify that the package installation is completed with these versions:

Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Downloading backup-manager/backup-manager (dev-patch-4 3472e53)
  - Downloading backup-manager/laravel (dev-laravel_9_support 928a14a)
  - Installing backup-manager/backup-manager (dev-patch-4 3472e53): Extracting archive
  - Installing backup-manager/laravel (dev-laravel_9_support 928a14a): Extracting archive

Notes: See the dev-patch-4 3472e53 is from this PR and dev-laravel_9_support 928a14a from this repo.

Update .env file

Update the .env file to configure the database name and credential in localhost:

DB_DATABASE=your_database_to_backup
DB_USERNAME=root
DB_PASSWORD=secret

Test the Backup Command

Now we can test the backup command. Run the backup command for local destination:

php artisan db:backup --database=mysql --destination=local --compression=gzip --destinationPath=/2023-02-12_2359

Verify that the backup process is successful:

  • No error on the backup process
  • We should now have the new backup file storage/app/2023-02-12_2359.gz

Test the Restore Command

Now try to change some records on the MySQL database, we want to make sure that these changes will be reverted after database restoration.

Run the restore command:

php artisan db:restore --database=mysql --source=local --compression=gzip --sourcePath=/2023-02-12_2359.gz

Verify that the restore process is successful:

  • No error on the backup proccess
  • The changed records are reverted to the original values

Screenshots

Here is the successful backup command

screen_2023-02-13_001

Here is the created backup file (in gzip)

screen_2023-02-13_002

Here is the successful restore command

screen_2023-02-13_003

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants