Problem with migration

After first have migrated from empty (no problem)
The migration from release gave the following error:

uccessfully created /home/coder/project/dist/project.pkg
/home/coder/project/migrations/from_release/migration.alan:4:33 to 4:34 error: unexpected keyword `?` while making a decision for stategroup 'select' of !'variable selector'.'stack'?'non-empty'. Options:
	- a key literal             for state 'branch'
	- keyword `.`               for state 'this'
	- keyword `>`               for state 'this'
	- keyword `^`               for state 'this'

the migration.alan file below shows an underscore under the question mark ? before ‘Type’

	'Users': collection = <!"Default collection mapping, should succeed when key-property remains the same."!> map ( $ .'Users' ) as $ = (
		'Naam': text = $ .'Naam'
		'Type': stategroup = switch $ ?'Type' (
			|'Admin' as $ = 'Admin' ( )
			|'User' as $ = 'User' ( )
		)
	)
	'Passwords': collection = <!"Default collection mapping, should succeed when key-property remains the same."!> map ( $ .'Passwords' ) as $ = (
		'User': text = $ .'User'
		'Data': group = $ +'Data' as $ (
			'Password': text = $ .'Password'
			'Active': stategroup = switch $ ?'Active' (
				|'No' as $ = 'No' ( )
				|'Yes' as $ = 'Yes' ( )
			)
		)
	)

after several migration attempts from empty and from release the error remains.
what is going wrong?

Can you delete/rename your ‘from_release’ migration directory so that a new one will be generated?

There have been changes in the migration language syntax in version 97 and I think you still have a migration.alan file that uses the old syntax, which causes this error message.

after deleted following message:

Successfully created /home/coder/project/dist/project.pkg
/home/coder/project/migrations/from_release error: unable to follow path step, directory misses entry:
	migration.alan
migrations/from_release notice: 1 errors

after renamed following message:

uccessfully created /home/coder/project/dist/project.pkg
/home/coder/project/migrations/from_release error: unable to follow path step, directory misses entry:
	migration.alan
/home/coder/project/migrations/from_release error: superfluous entry in a static directory:
	migrations.alan
migrations/from_release notice: 2 errors

after migration emptied except ‘root’:

Successfully created /home/coder/project/dist/project.pkg
/home/coder/project/migrations/from_release/migration.alan:1:19 to 1:19 error: missing entry `Users` in 'properties'
/home/coder/project/migrations/from_release/migration.alan:1:19 to 1:19 error: missing entry `Passwords` in 'properties'
/home/coder/project/migrations/from_release/migration.alan:1:19 to 1:19 error: missing entry `Presets` in 'properties'
/home/coder/project/migrations/from_release/migration.alan:1:19 to 1:19 error: missing entry `Componenten` in 'properties'
/home/coder/project/migrations/from_release/migration.alan:1:19 to 1:19 error: missing entry `Calculatie` in 'properties'
		defined by .<root> of type 'application'!'node'
	 at /home/coder/project/models/model/application.alan:25:2 to 786:51
/home/coder/project/migrations/from_release/migration.alan notice: 5 semantic errors, with 0 unknown

Is this still an issue and if so, can you share the name of your IDE account with me in a private message?

This has already been resolved, but I will share some of the details which might be useful to other people with the same question.

The migrations/from_release directory will not be overwritten once it already exists.

In this case, the migration language syntax was changed after a project upgrade. We have resolved it by running ‘Alan: Generate Migration’ from the Command Palette in the online IDE.

More information about migrations can be found on Application data migration - Alan Application Platform

1 Like