Skip to content

duannyuuu/appwrite-backup

Repository files navigation

Appwrite Backup & Migration πŸš€

This repository contains scripts to export and import Appwrite database schemas and data.

🎯 Features

βœ… Export and import Appwrite database schema

βœ… Backup and restore database records

βœ… Automated scripts using Node.js

πŸ“Œ How to Use

  1. Install Dependencies
npm install node-appwrite --save
  1. Export Database Schema
node export-schema.js
  1. Import Database Schema
node import-schema.js
  1. Export Data
node export-data.js
  1. Import Data
node import-data.js

βš™οΈ Configuration

Before running the scripts, update your Appwrite API credentials inside the JavaScript files.

Required Configurations

You need to replace the placeholders with your actual Appwrite credentials in the scripts:

const client = new sdk.Client()
  .setEndpoint('http://your-appwrite-server/v1') // πŸ”Ή Your Appwrite server URL
  .setProject('your_project_id') // πŸ”Ή Replace with your Appwrite project ID
  .setKey('your_api_key'); // πŸ”Ή Replace with your Appwrite API Key

const databaseId = 'your_database_id'; // πŸ”Ή Replace with your Database ID
const collectionId = 'your_collection_id'; // πŸ”Ή Replace with your Collection ID

Additionally, some scripts require further modifications, including:

  • JSON file paths (e.g., for backups and imports)
  • targetCollectionId (e.g., if importing into a different collection)
  • backupDatabaseId (e.g., if backing up to a different database) ......

✨ These additional configurations are explained in the respective JavaScript files as comments.

πŸ” Before running any script, check the file and modify these values accordingly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published