#migrate files
8 messages · Page 1 of 1 (latest)
Hi @lime pilot. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Yes, it is possible to migrate both files and a whole table from one Convex project to another.
The recommended approach is to use the export and import features:
-
Export Data and Files: You can export your data (including files stored in Convex File Storage) by taking a backup from the dashboard or using the CLI:
npx convex export --path <your_backup_path>This will create a ZIP file containing your tables and files. The backup preserves document IDs and file storage references, ensuring relationships between tables and files are maintained Data Export.
-
Import into New Project: In your new project, you can import the backup ZIP file:
npx convex import <path_to_backup_zip>This will restore all tables and files included in the backup. If the tables already exist, you can use the
--replaceflag to overwrite them. The import process is atomic and preserves IDs and creation times Data Import.
This method is commonly used for one-time migrations between projects or deployments, such as moving from a development to a production environment or reusing an old project as a template for a new one. Note that only the tables and files included in the backup will be affected; other deployment configuration (like code and environment variables) is not included and must be migrated separately if needed Backup & Restore.
If you need to migrate only a single table, you can export/import just that table using CSV, JSON, or JSONLines formats, but file storage migration is only supported via the ZIP backup method.
Summary:
- Use
npx convex exportto back up your old project (including files). - Use
npx convex importin your new project to restore the data and files.
For more details, see the official documentation:
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@lime pilot Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@zenith apex
i need toexport only files and import them on another project, is this possible?
Let me check the knowledge base for you again. One moment! :books:
Based on the available knowledge sources, Convex does not provide a documented, built-in way to export and import only files (i.e., just the file storage) between projects. The standard export/import workflow using a ZIP backup includes all tables and their associated files, not just the files themselves.
There is a mention in the documentation and Discord support that importing individual tables via the CLI does not handle storage files, and that partial imports (such as only files) would require manual modification of the ZIP file, but this process is undocumented and not officially supported. If you want to attempt this, you would need to manually edit the backup ZIP to include only the _storage folder and its metadata, but you should proceed with caution and may want to reach out to the Convex team for guidance if you run into issues How can I import only specific tables and their associated storage files from a Convex backup ZIP?.
In summary:
- There is no officially documented way to export/import only files.
- The only supported method is to export/import the entire backup ZIP, which includes all tables and files.
- Manual ZIP modification for partial imports is possible but undocumented and not guaranteed to work.