db-clone

Copy a Cloudflare D1 database between environments within the same app.

10|Updated Sep 24, 2025
One-click install
npx skills add https://github.com/FriendlyInternet/nuxt-crouton --skill db-clone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-clone
Source: https://github.com/FriendlyInternet/nuxt-crouton/tree/main/.claude/skills/db-clone
Command: npx skills add https://github.com/FriendlyInternet/nuxt-crouton --skill db-clone

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill solves the problem of mirroring one Cloudflare D1 database into another within the same app's environments, ensuring data consistency and integrity across environments like STAGING and PROD.

Core Features & Use Cases

  • Database Cloning: Copies an entire database from one environment to another, ensuring an exact mirror.
  • Dry Run Option: Provides a dry run feature to preview the clone process without making any changes.
  • Backup: Automatically creates a backup before cloning, safeguarding against data loss.
  • Use Case: Use this Skill to refresh STAGING from PROD, seed a PREVIEW from STAGING, or reconstitute a wiped staging DB, ensuring that data is always up-to-date and recoverable.

Quick Start

Run the db-clone skill to clone the 'velo-db' from PROD to STAGING.

Frequently Asked Questions about db-clone

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clone a Cloudflare D1 database from PROD to STAGING?

Cloning a Cloudflare D1 database across environments requires the app's wrangler.jsonc for database discovery and valid Cloudflare credentials. The skill copies the entire database from one environment to another, ensuring exact data replication within the same app.

Can I preview a D1 database clone before making changes?

You can preview a D1 database clone using the dry run option, which simulates the clone process without making any changes. This feature requires explicit confirmation before executing, ensuring safety against unintended data loss.

Does cloning a Cloudflare D1 database create a backup automatically?

Yes, cloning a Cloudflare D1 database automatically creates a backup before cloning, safeguarding against data loss. This ensures data is always up-to-date and recoverable when mirroring databases across app environments like STAGING and PROD.

What do I need to mirror a D1 database across app environments?

To mirror a D1 database across app environments, you need the app's wrangler.jsonc file for database discovery and valid Cloudflare credentials for execution. These prerequisites ensure precise and safe data replication between environments.

When should I use database cloning for environment synchronization?

Use database cloning for environment synchronization when you need to refresh STAGING from PROD, seed a PREVIEW from STAGING, or reconstitute a wiped staging DB. It ensures data consistency and integrity across environments.

Why does my D1 database cloning require a wrangler.jsonc file?

D1 database cloning requires a wrangler.jsonc file for database discovery within the same app. This ensures the skill accurately identifies the source and target environments to perform precise and safe data replication.