mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-05-08 19:22:57 +00:00

Former-commit-id: 9548d370497e13d436abbc670cf40d360badab9f [formerly f29ba9c4dcf9962c3a5045629526296cd2b43ad8] [formerly 3f89c094c1b3330c8d6f1b2379d6309567d12210 [formerly 92fda0070cb61c3739fdfe340b65a39fd73eda8b]] Former-commit-id: 4ad64211019e0236f0eaa6e041a8793e899954fe [formerly 6bf71ffba205b563ff6cd0c7487d9a328c757686] Former-commit-id: 4c7afe072fc3e2a225ca5a7dbf3f3beb66b44058
31 lines
764 B
Go
31 lines
764 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/filebrowser/filebrowser/v2/storage/bolt/importer"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(importCmd)
|
|
|
|
importCmd.Flags().String("old.database", "", "")
|
|
importCmd.Flags().String("old.config", "", "")
|
|
importCmd.MarkFlagRequired("old.database")
|
|
}
|
|
|
|
var importCmd = &cobra.Command{
|
|
Use: "import",
|
|
Short: "Imports an old configuration",
|
|
Long: `Imports an old configuration. This command DOES NOT
|
|
import share links because they are incompatible with
|
|
this version.`,
|
|
Args: cobra.NoArgs,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
oldDB := mustGetString(cmd, "old.database")
|
|
oldConf := mustGetString(cmd, "old.config")
|
|
|
|
err := importer.Import(oldDB, oldConf, databasePath)
|
|
checkErr(err)
|
|
},
|
|
}
|