Warning

The product is in closed beta and not open to the public.

import

vb import [SUBCOMMAND] [OPTIONS] NEW-REPOSITORY [INPUT-FILE]

Description

Read interchange format generated by another VCS and use it to construct a new VisionByte repository named by the NEW-REPOSITORY argument. If no input file is supplied the interchange format data is read from standard input.

The –incremental option extends an existing Git or SVN import. The –rename-* options may be useful to avoid name conflicts when using the –incremental option. The –admin-user option is ignored if –incremental is specified.

The patterns for –rename-branch and –rename-tag contain one % character to be replaced with the original name. For example, --rename-tag svn-%-tag renames the tag called release to svn-release-tag.

--ignore-tree is useful for importing Subversion repositories which
move branches to subdirectories of ``branches/deleted`` instead of
deleting them.  It can be supplied multiple times if necessary.

The –attribute option takes a quoted string argument comprised of a Git committer email and the username to be attributed to corresponding check-ins in the VisionByte repository. This option can be repeated. For example, –attribute drh@sqlite.org drh –attribute xyz@abc.net X. Attributions are persisted to the repository so that subsequent vb git export operations attribute VisionByte commits to corresponding Git Committer <git@committer.com> users, and incremental imports with vb import --git --incremental use previous –attribute records.

Options

-i, --incremental

Extend an existing Git or SVN import

-f, --force

Overwrite repository if already exists

-q, --quiet

Omit progress output

--no-rebuild

Skip the rebuilding metadata step

--no-vacuum

Skip the final VACUUM of the database file

--rename-trunk NAME

Use NAME for the imported Git or SVN trunk branch

--rename-branch PAT

Rename all branch names using PAT pattern

--rename-tag PAT

Rename all tag names using PAT pattern

-A, --admin-user NAME

Use NAME for the admin user

Subcommands

vb import –git

vb import --git [OPTIONS] NEW-REPOSITORY [INPUT-FILE]

Description

Import from the git-fast-export file format (default)

Options

--import-marks

FILE Restore marks table from FILE

--export-marks

FILE Save marks table to FILE

--rename-master

NAME Renames the master branch to NAME

--use-author

Uses author as the committer

--attribute

EMAIL USER Attribute commits to USER instead of Git committer EMAIL address

vb import –svn

vb import --svn [OPTIONS] NEW-REPOSITORY [INPUT-FILE]

Description

Import from the svnadmin-dump file format behaviour (unless overridden by –flat) is to treat 3 folders in the SVN root as special, following the common layout of SVN repositories. These are (by default) trunk/, branches/ and tags/. The SVN –deltas format is supported but not required.

Options

--trunk FOLDER

Name of trunk folder

--branches FOLDER

Name of branches folder

--tags FOLDER

Name of tags folder

--base PATH

Path to project root in repository

--flat

The whole dump is a single branch

--rev-tags

Tag each revision, implied by -i

--no-rev-tags

Disables tagging effect of -i

--rename-rev PAT

Rev tag names, default svn-rev-%

--ignore-tree DIR

Ignores subtree rooted at DIR

vb import –p4

vb import --p4 [OPTIONS] NEW-REPOSITORY [DEPOT-PATH]

Description

Import submitted Perforce history into a new repository. Requires the p4 client and uses its connection and authentication settings.

DEPOT-PATH is a stream depot root: //DEPOT/… Mainline, development and release streams become branches named after their relative stream paths. Use –rename-branch PAT to rename them. Use –stream PATH to select one stream and –branch NAME to set its VB branch. PATH is relative to the depot or a full //DEPOT/STREAM.

Preserves descriptions, authors, timestamps, file contents and modes. Branch and merge parents are added when verified from P4 history. Paired moves within a stream preserve renames. P4 labels, changelist IDs and file-level integration records are not retained.

Use –resume on the first run to enable recovery, then repeat the same command after interruption. Keep the repository and its .p4state file together until completion; recovery state is then removed.

Incremental import is not supported. –p4-after filters changes without a starting snapshot, so unchanged files from earlier changes are omitted.

Options

--resume

Enable recovery after interruption

--p4-exe EXE

P4 client executable (default: p4)

--stream PATH

Import only this stream

--branch NAME

VB branch name (requires –stream)

--p4-after CHANGE

Import changelists after CHANGE (default: 0)

--p4-to CHANGE

Import up to CHANGE, inclusive (default: latest)

--p4-max-file-size N

Reject files over N bytes (default: 0, no limit)

--p4-no-merges

Skip merge-parent detection

See Also

See also

git

Examples

  • Import from Git using a pipe

cd /path/to/git-repo
git fast-export --all | vb import --git ../demo.vbyte

Omit the input filename to read the export stream from standard input. Git exports all refs, and VB creates the destination repository directly without an intermediate export file.

On Windows, use Git Bash, cmd.exe, or PowerShell 7.4 or later to preserve binary data in native-command pipes. From an older PowerShell session, run the pipeline through cmd.exe while inside the Git repository:

cmd /c "git fast-export --all | vb import --git ..\demo.vbyte"
  • Import from a saved git-fast-export file

git fast-export --all > repo.export
vb import --git demo.vbyte repo.export
  • Import incrementally and preserve Git authors

git fast-export --all > repo.export
vb import --git --incremental --use-author demo.vbyte repo.export
  • Import from an svnadmin dump with custom layout

svnadmin dump /path/to/repo > repo.svndump
vb import --svn --trunk trunk --branches branches --tags tags demo.vbyte repo.svndump
  • Configure the P4 connection before importing

The P4 client must be available on PATH, or selected with --p4-exe. VB inherits the current P4 environment and authentication. For example, in PowerShell:

$env:P4PORT = 'ssl:p4.example.com:1666'
$env:P4USER = 'alice'
p4 login
p4 info

Complete the normal P4 server trust setup if required. The final argument to vb import --p4 is a depot path ending in /..., not the server address. Git and Python are not required for P4 imports.

  • Discover branches automatically in a stream depot

vb import --p4 game.vbyte '//game/...'

Use the complete stream depot root, //DEPOT/.... Ordinary mainline, development and release streams are mapped to VB branches. For example, //game/main becomes main and //game/features/rendering becomes features/rendering. The first mainline with selected history in lexical order becomes the repository main branch; if there is none, the first eligible stream is used.

This imports physical file history under each stream path. Historical stream views, remapping, exclusions and external imports are not reconstructed.

  • Apply a naming pattern to imported P4 branches

Prefix every automatically discovered stream branch with p4-:

vb import --p4 --rename-branch 'p4-%' game-prefixed.vbyte '//game/...'

Here //game/main becomes p4-main, //game/dev becomes p4-dev, and //game/features/rendering becomes p4-features/rendering. The % placeholder is replaced with the complete original branch name.

Branch naming is saved with the migration. Reuse the same depot root and naming policy for retries, or omit them to reuse the saved configuration.

For complete selected histories, VB infers branch origins and later merge parents from verified P4 integration records. A stream’s configured parent or a changelist description alone does not establish a commit parent. Partial integrations can contribute to a merge parent on a later changelist when the accumulated evidence becomes complete.

  • Import up to a changelist

vb import --p4 --resume --p4-to 100 game-staged.vbyte '//game/...'

--p4-to includes the specified changelist. Without it, VB determines the latest selected changelist at the start of the run. Retries reuse the saved stream mappings and upper bound.

With --resume, VB creates a paired migration state file, such as game-staged.vbyte.p4state. Keep it with the repository until the import completes; it is removed after success. Incremental P4 import is not supported.

--p4-after skips older changes without creating an initial snapshot, so it can omit unchanged files and disables branch-origin and later merge inference when nonzero.

  • Resume an interrupted P4 import

Repeat the original command after resolving the error. For example, if the stream import above was interrupted:

vb import --p4 --resume --p4-to 100 game-staged.vbyte '//game/...'

Recovery must be enabled with --resume on the initial run and each retry. Successfully checkpointed changelists are retained and are not imported again. Preserve both game-staged.vbyte and game-staged.vbyte.p4state; do not use --force to resume, since it replaces the migration.

  • Select a P4 executable on Windows and skip the final database compaction

vb import --p4 --p4-exe 'C:\Program Files\Perforce\p4.exe' --no-vacuum custom-client.vbyte '//depot/...'

--no-vacuum skips the final VACUUM while retaining metadata rebuilding. Normal progress and timing output remain enabled; add --quiet to hide them.

The importer automatically reuses verified ordinary binary copies and omits file replacements already inherited with the same content and mode. The P4: Content summary reports downloaded, reused, and inherited files; P4: Metadata reports describe calls and filelog cache hits. These caches hold metadata only and start empty on each run. No additional option is needed.

  • Import stream histories without inferring later merge parents

vb import --p4 --p4-no-merges no-merges.vbyte '//depot/...'

Branch-origin checks still apply. --p4-no-merges only disables inference of later merge parents, and the selected policy is preserved for retries.