Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

nocobase-app-backup

БесплатноБез исполняемых скриптовНе проверен

Create, inspect, verify, and restore NocoBase 3 application database and upload backups. Use for app-level backups in code, deployment rollback, or offline…

nocobaseот nocobase★ 25 082 звезды на GitHub

Об этом скилле

Back up and restore a NocoBase application

Use the same application version and secrets key versions for backup and restore. For rollback, switch the deployment back to the version in the backup manifest before restoring. Keep the app and its supervisor stopped during restore. Use the same application storage volume for the app and the command so they share startup and Drive coordination. Stop replicas on other volumes and keep them stopped for the full operation.

Backups are unencrypted. Restrict access to the archive and to the directory used for temporary work. Keep the SHA-256 separately so it can be checked before restore.

CLI

In source use pnpm nocobase. In a built deployment use node dist/cli/index.js from the application directory or node cli/index.js from the deployment directory. Use commands --json on the installed CLI to confirm that it exposes the four backup commands.

pnpm nocobase backup create --output ./backups/app.tar.gz --json
pnpm nocobase backup inspect ./backups/app.tar.gz --json
pnpm nocobase backup verify ./backups/app.tar.gz --sha256 "$BACKUP_SHA256" --json
pnpm nocobase backup restore ./backups/app.tar.gz --sha256 "$BACKUP_SHA256" --json

Create the output directory first. Keep the output directory separate from a disk root. The CLI checks the current target in verify. Use verify --archive-only to check integrity independently of the target. Use --offline on create to require a stopped application.

  • Backup defaults to managed connections and configured disks. Use repeatable --include-connection, --exclude-connection, --include-disk and --exclude-disk to select targets. For example, --exclude-disk deployment-artifacts preserves the artifacts disk when that is its configured name.
  • Restore only named databases with repeatable --connection <name> and --allow-partial. Use --files-only to recover local files from a compatible archive while preserving the current databases. Integrity, target compatibility, and shutdown checks still apply.
  • Provision versioning for S3 or OSS and restore objects through that service. The archive records remote disk references.
  • A successful create includes a validated dump of every selected database. An export failure leaves no new backup archive. If an upgrade requires a backup, stop the upgrade when that backup fails. Restore reports missing file references and includes per-connection rollback status on failure.
  • SIGINT and SIGTERM abort the operation and clean working files. A later backup can remove unpublished scratch owned by an identifiable dead process in the same process namespace. Keep retained pre-restore database exports and disk recovery directories after a forced termination or rollback failure until recovery is complete.

Library integration

import { resolveAppBackupTarget } from '@nocobase/app-server';
import { createBackup, inspectBackup, verifyBackup } from '@nocobase/backup';

const target = await resolveAppBackupTarget(app);
const saved = await createBackup(target, {
  output: '/srv/backups/app.tar.gz',
  excludeDisks: ['deployment-artifacts'],
});
const manifest = await inspectBackup(saved.file);
const verified = await verifyBackup(saved.file, {
  target,
  sha256: saved.sha256,
});

Store saved.sha256 and the per-connection modes with the backup record. Pass an AbortSignal when cancellation is available. Run restore through the stopped application's CLI.

The app resolver reads migration history and file references from the exported snapshot. It detects tables with physical disk and key columns. Configure other layouts in backup.fileReferences with table, keyColumn, and either disk or diskColumn. Set connection for a non-default connection and schema when needed. Add keyPrefix when the database stores keys relative to a subdirectory of the disk.

Set backup.disks.<diskName>.excludePaths to omit runtime directories or configuration files from a named filesystem disk and retain their live contents on restore. Every path must stay below that disk's root, including after resolving symlinks. Unknown or non-filesystem disk names are invalid. The application continues to exclude database files, framework runtime directories, other disks, and backup workspaces automatically.

backup:
  disks:
    uploads:
      excludePaths: [cache, tmp]
    documents:
      excludePaths: [previews]

Retry BACKUP_FILE_CHANGED after uploads finish. It means a file included in the archive was replaced during capture. The new file is still available to Drive, and the archive was not published. Configure factory disks as declarative Drive disks before backup. A factory has no storage metadata that backup can use to isolate its files, even if it is explicitly excluded.

Declare a dedicated database per PostgreSQL or MySQL connection. Use standard Drive filesystem disk definitions to include their bytes and coordinate deletion. Use local or shared filesys

Полный SKILL.md на GitHub

Установить nocobase-app-backup в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл nocobase-app-backup?

Create, inspect, verify, and restore NocoBase 3 application database and upload backups. Use for app-level backups in code, deployment rollback, or offline database and file recovery.

Как установить скилл nocobase-app-backup?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл nocobase-app-backup запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить nocobase-app-backup с