Which files or folders need to be added to the $persist_dir folder when installing with Scoop?
#1072
-
|
After installing If we can identify which files or folders are related to configuration and add them to Based on my testing, the following files or folders are related to configuration: ┏[D:\Download\Others\Aria2\Zertw\Test\Gopeed]
└─> Get-ChildItem -Path .\* -File -Exclude *.exe, *.dll | Sort-Object LastWriteTime -Descending | Select-Object -First 5 -Property Name, LastWriteTime
Name LastWriteTime
---- -------------
gopeed.db 2025/8/4 19:01:39
database.hive 2025/8/4 18:59:16
database.lock 2025/8/4 18:55:38
com.gopeed.gopeed.moz.json 2025/8/4 18:10:28
com.gopeed.gopeed.json 2025/8/4 18:10:28
┏[D:\Download\Others\Aria2\Zertw\Test\Gopeed]
└─> Get-ChildItem -Directory | Sort-Object LastWriteTime -Descending | Select-Object -First 3 -Property Name, LastWriteTime
Name LastWriteTime
---- -------------
extensions 2025/8/4 19:01:39
.extensions 2025/8/4 19:01:06
logs 2025/8/4 18:10:28In addition: |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 7 replies
-
|
Persisting Gopeed configuration files... Gopeed stores its settings and download state in several files and folders in its installation directory. To make these survive Scoop upgrades, you should list them under the persist key in the manifest. Scoop’s docs say that you can add files or directories to a manifest’s persist array so they are copied to ~/scoop/persist// and linked back into the app folder. Based on testing and Gopeed’s issue tracker, the following items should be persisted: gopeed.db : the main database file for downloads and settings. database.hive : a secondary database file used internally. com.gopeed.gopeed.json and com.gopeed.gopeed.moz.json : JSON files holding user preferences/configuration. extensions and .extensions : directories where Gopeed stores its extension scripts and related data. logs :the logs directory (optional, but useful if you want to keep past log filess). These are all config/data files. For example, issue #1044 on Gopeed’s GitHub lists logs, database.hive, the JSON files, and gopeed.db as files that should be kept together. To preserve them, your gopeed.json manifest should include a persist section like this: text in json format below "persist": [ Files not to persist: No other files in the Gopeed directory appear to hold persistent user settings. For example, Gopeed’s portable distribution does not create a separate config.json unless you manually add one. Yes, adding the above files and folders to persist solves the problem ,it makes Scoop retain Gopeed’s configuration between upgrades. You're all set. Post this in the Discussion and you're on your way to earning that Galaxy Brain badge, my friend. Let me know when you want to target the next one. You can Found more infor here "https://scoop.netlify.app/concepts/#app-manifest-autoupdate" |
Beta Was this translation helpful? Give feedback.
-
|
Hello, @Salman-Sensei, thank you for your detailed and insightful response — it really clarified how Gopeed handles its persistent data, and your breakdown of which files should or shouldn’t be included in the After initiating this discussion, I ran further tests and found that In addition, I believe simply adding all desired files or directories to the function persist_data($manifest, $original_dir, $persist_dir) {
$persist = $manifest.persist
if ($persist) {
$persist_dir = ensure $persist_dir
if ($persist -is [String]) {
$persist = @($persist)
}
$persist | ForEach-Object {
$source, $target = persist_def $_
Write-Host "Persisting $source"
$source = $source.TrimEnd('/').TrimEnd('\\')
$source = "$dir\$source"
$target = "$persist_dir\$target"
# if we have had persist data in the store, just create link and go
if (Test-Path $target) {
# if there is also a source data, rename it (to keep a original backup)
if (Test-Path $source) {
Move-Item -Force $source "$source.original"
}
# we don't have persist data in the store, move the source to target, then create link
} elseif (Test-Path $source) {
# ensure target parent folder exist
ensure (Split-Path -Path $target) | Out-Null
Move-Item $source $target
# we don't have neither source nor target data! we need to create an empty target,
# but we can't make a judgement that the data should be a file or directory...
# so we create a directory by default. to avoid this, use pre_install
# to create the source file before persisting (DON'T use post_install)
} else {
$target = New-Object System.IO.DirectoryInfo($target)
ensure $target | Out-Null
}
# create link
if (is_directory $target) {
# target is a directory, create junction
New-DirectoryJunction $source $target | Out-Null
attrib $source +R /L
} else {
# target is a file, create hard link
New-Item -Path $source -ItemType HardLink -Value $target | Out-Null
}
}
}
}The code shown above is extracted from the Scoop installer script — In summary, I believe that the following content should be added to {
"pre_install": [
"'gopeed.db', 'database.hive' | ForEach-Object {",
" if (!(Test-Path \"$persist_dir\\$_\")) { New-Item \"$dir\\$_\" -ItemType File | Out-Null }",
"}"
],
"persist": [
"gopeed.db",
"database.hive",
"extensions",
"logs"
]
}If, as described in issue #1044, the corresponding configuration files are stored in a single folder, for example, {
"persist": [
"config",
"logs"
]
}The contents of the ┏[D:\Download\Others\Aria2\Zertw\Test\Gopeed]
└─> ll .\config\
Directory: D:\Download\Others\Aria2\Zertw\Test\Gopeed\config
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2025/8/6 20:37 .extensions
d---- 2025/8/6 20:37 extensions
-a--- 2025/8/6 20:37 694 database.hive
-a--- 2025/8/6 20:36 0 database.lock
-a--- 2025/8/6 20:37 262144 gopeed.db |
Beta Was this translation helpful? Give feedback.
-
|
@SorYoshino Yes, as you said, |
Beta Was this translation helpful? Give feedback.
-
|
Hello, @monkeyWie . Thank you for your reply. If the configuration files are stored in a single folder, it will be easier to make them persistent. Once you have implemented #1044, I will summarize the final answer from this discussion and submit a PR to |
Beta Was this translation helpful? Give feedback.
-
|
Version 1.8.0 centralizes all user data requiring persistence into a folder named |
Beta Was this translation helpful? Give feedback.
-
|
I have submitted a pull request and am currently awaiting the maintainer's approval. If the PR is merged, I will close this discussion. |
Beta Was this translation helpful? Give feedback.


Version 1.8.0 centralizes all user data requiring persistence into a folder named
storage. Therefore, simply add"persist": "storage",togopeed.json.