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) )
Either the path of the new
Optional, if there is only one table in the
an object that inherits from DBIDriver, or an existing DBIConnection object (in order to clone an existing connection).
A DBIConnection object, as returned by
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)#>  "/tmp/RtmpXMlGMn/tmpdir/rasters"#>  "/tmp/RtmpXMlGMn/tmpdir/cacheOutputs"#>  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#>#> loaded cached result from previous rnorm call,