Open bigraymasoom opened 3 months ago
Hey! The purpose of this tool is to migrate the schema only - documents will be left where they are.
Moving documents about is something that is already supported by Appwrite CLI, with the caveat that it will wipe all existing data.
I build this tool to allow the migration of schema, so that you can make incremental updates to your schema from environment to environment, without loss of data in said environment.
Thanks a lot it helped me a lot a lot. One issue I am facing is that only first 25 collections are migrated to the new instance for all the databases.
No problem. :)
The issue you mention in latest comment - is that with this tool, or with the Appwrite CLI?
Tool
Hmm, I haven't had that many collections personally so haven't tested it... Docs on Appwrite don't mention a max limit of collections returned that I could see, or any sort of paging information...
I will check it out...
Default limit is 25 if you don't pass limit query.
I'll look into sorting this :)
Default limit is 25 if you don't pass limit query.
I've made a fix for this, but am unable to test it properly currently. 0.1.3-alpha is available on nuget and should resolve this for you, let me know if it works or not :)
Will test today and share the results. Thanks. It will be even perfect if you add a way for migrating documents in collections because appwrite CLI also only supports collections and databases not documents. Again thanks, will test today
Collections were successfully created but attributes creation error after creating some attributes.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Appwrite.Models.AttributeString.From(Dictionary2 map) at Appwrite.Client.Call[T](String method, String path, Dictionary
2 headers, Dictionary2 parameters, Func
2 convert)
at PinguApps.AppwriteMigrator.AppwriteCommands.CreateAttribute(Databases dbClient, Attribute attribute, String databaseId, String collectionId) in /home/runner/work/AppwriteMigrator/AppwriteMigrator/src/PinguApps.AppwriteMigrator/AppwriteCommands.cs:line 351
at PinguApps.AppwriteMigrator.AppwriteCommands.Migrate(String endpoint, String projectId, String apiKey, String fileName) in /home/runner/work/AppwriteMigrator/AppwriteMigrator/src/PinguApps.AppwriteMigrator/AppwriteCommands.cs:line 231
at Cocona.Command.Dispatcher.Middlewares.CoconaCommandInvokeMiddleware.DispatchAsync(CommandDispatchContext ctx)
at Cocona.Command.Dispatcher.Middlewares.HandleParameterBindExceptionMiddleware.DispatchAsync(CommandDispatchContext ctx)
at Cocona.Command.Dispatcher.Middlewares.HandleExceptionAndExitMiddleware.DispatchAsync(CommandDispatchContext ctx)
Hm, not sure why that would be happening...
Immediately before the error there should be some console output... Specifically I would be looking for a line immediately before saying Creating Attribute {attribute.Key}...
with the obvious replacement...
If you are able to identify the attribute that its referencing, and find it in the source database (or the schema file that it created when running the sync command), that would be super useful and allow me to debug it further. :)
Sure will share soon.
Question
I was curious to know if this tool also migrate documents along with collections.
Additional Context
No response