If a user manually copies a complete Cache folder (including the db file and rasters folder), there are issues that must be addressed. Primarily, the db table must be renamed. Run this function after a manual copy of a cache folder. See examples for one way to do that.

movedCache(
new,
old,
drv = getOption("reproducible.drv", RSQLite::SQLite()),
conn = getOption("reproducible.conn", NULL)
)

## Arguments

new Either the path of the new cachePath where the cache was moved or copied to, or the new DB Table Name Optional, if there is only one table in the new cache path. Either the path of the previous cachePath where the cache was moved or copied from, or the old DB Table Name an object that inherits from DBIDriver, or an existing DBIConnection object (in order to clone an existing connection). A DBIConnection object, as returned by dbConnect().

## Examples

tmpCache <- file.path(tempdir(), "tmpCache")
tmpdir <- file.path(tempdir(), "tmpdir")
bb <- Cache(rnorm, 1, cacheRepo = tmpCache)

# Copy all files from tmpCache to tmpdir
froms <- normPath(dir(tmpCache, recursive = TRUE, full.names = TRUE))
checkPath(file.path(tmpdir, "rasters"), create = TRUE)#> [1] "C:/Users/EMCINT~1.L-V/AppData/Local/Temp/RtmpamdaBp/tmpdir/rasters"checkPath(file.path(tmpdir, "cacheOutputs"), create = TRUE)#> [1] "C:/Users/EMCINT~1.L-V/AppData/Local/Temp/RtmpamdaBp/tmpdir/cacheOutputs"file.copy(from = froms, overwrite = TRUE,
to = gsub(normPath(tmpCache), normPath(tmpdir), froms))#> [1] TRUE TRUE
# Must use 'movedCache' to update the database table
movedCache(new = tmpdir, old = tmpCache)
bb <- Cache(rnorm, 1, cacheRepo = tmpdir) # should recover the previous call#>   ...(Object to retrieve (7072c305d8c69df0.rds))#>      loaded cached result from previous rnorm call,