Learn R Programming

drake (version 5.2.1)

migrate_drake_project: Reconfigure an old project (built with drake <= 4.4.0) to be compatible with later versions of drake.

Description

Deprecated on May 4, 2018. Migrate a project/cache from drake 4.4.0 or earlier to be compatible with the version of drake on your system.

Usage

migrate_drake_project(path = drake::default_cache_path(), jobs = 1)

Arguments

path

Full path to the cache

jobs

number of jobs for light parallelism. (Disabled on Windows.)

Value

TRUE if the migration was successful, FALSE otherwise. A migration is successful if the transition preserves target status: that is, outdated targets remain outdated and up to date targets remain up to date.

Details

Drake versions after 4.4.0 have a different internal structure for the cache. This means projects built with drake 4.4.0 or before are not compatible with projects built with a later version of drake. The migrate_drake_project() function converts an old cache to a format compatible with the version of drake installed on your system. Important note: build times and other non-essential metadata are lost during migration. A migration is successful if the transition preserves target status: that is, outdated targets remain outdated and up to date targets remain up to date. At the end, migrate_drake_project() tells you whether the migration is successful. If it is not successful, migrate_drake_project() tells you where it backed up your old project.

See Also

rescue_cache(), make()

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
# With drake 4.3.0:
load_mtcars_example() # Get the code with drake_example("mtcars").
make(my_plan) # Run the old project.
# Now, install drake >= 5.0.0
load_mtcars_example() # Get the code with drake_example("mtcars").
make(my_plan) # Error: cache is not back compatible.
# Convert the project's '.drake/' cache to the new format.
migrate_drake_project()
make(my_plan) # Everything is still up to date!
# Outdated objects from before migration
# should remain out of date afterwards.
config <- drake_config(my_plan)
outdated(config)
})
# }

Run the code above in your browser using DataLab