migrate

package
v0.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module handles migration between Port organizations.

func NewModule

func NewModule(sourceToken, targetToken *auth.Token, sourceConfig, targetConfig *config.OrganizationConfig) *Module

NewModule creates a new migration module.

func (*Module) Close

func (m *Module) Close() error

Close closes both API clients.

func (*Module) Execute

func (m *Module) Execute(ctx context.Context, opts Options) (*Result, error)

Execute performs the migration operation.

type Options

type Options struct {
	Blueprints                    []string
	DryRun                        bool
	SkipEntities                  bool
	SkipSystemBlueprints          bool // skip _* blueprint schemas and their entities
	SkipSystemBlueprintProperties bool
	IncludeRuleResults            bool // include _rule_result system blueprint entities (included by default)
	IncludeResources              []string
	ExcludeBlueprints             []string // deep: exclude blueprint schema + all its resources
	ExcludeBlueprintSchema        []string // shallow: exclude only the blueprint schema, keep resources
	UsersAsDisabled               bool     // import non-admin users as DISABLED after staging
	ErrorHandling                 import_module.ErrorHandlingOptions

	// AutoScopeBlueprints, when true, narrows the blueprint schemas returned by
	// exportFromSource to only the blueprints referenced by a matching
	// scorecard, action, or entity (see FilterBlueprintsToReferenced and
	// blueprintHasMatchingEntity). It is false whenever the caller explicitly
	// requested blueprints via --blueprints or --include blueprints.
	AutoScopeBlueprints bool

	// Per-resource ID filters (client-side, applied after bulk fetch)
	Entities     []string
	Scorecards   []string
	Actions      []string
	Pages        []string
	Integrations []string
	Teams        []string
	Users        []string
}

Options represents migration options.

type Result

type Result struct {
	Success                              bool
	Message                              string
	BlueprintsCreated                    int
	BlueprintsUpdated                    int
	BlueprintsSkipped                    int
	EntitiesCreated                      int
	EntitiesUpdated                      int
	EntitiesSkipped                      int
	ScorecardsCreated                    int
	ScorecardsUpdated                    int
	ScorecardsSkipped                    int
	ActionsCreated                       int
	ActionsUpdated                       int
	ActionsSkipped                       int
	TeamsCreated                         int
	TeamsUpdated                         int
	TeamsSkipped                         int
	UsersCreated                         int
	UsersUpdated                         int
	UsersSkipped                         int
	PagesCreated                         int
	PagesUpdated                         int
	PagesSkipped                         int
	IntegrationsUpdated                  int
	IntegrationsSkipped                  int
	BlueprintPermissionsUpdated          int
	ActionPermissionsUpdated             int
	PagePermissionsUpdated               int
	BlueprintsToCreate                   []string
	BlueprintsToUpdate                   []string
	BlueprintsToSkip                     []string
	BlueprintPermissionsToUpdate         []string
	ActionPermissionsToUpdate            []string
	PagePermissionsToUpdate              []string
	Errors                               []string
	Warnings                             []string
	DiffResult                           *import_module.DiffResult
	IgnoredRuleResultTargetRelationCount int
	IgnoredRuleResultTargetRelationKeys  []string
}

Result represents the result of a migration operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL