is a powerful configuration backup, restoration, and synchronization tool for Windows, written in C++. It allows you to seamlessly manage configuration files for multiple programs, ensuring consistency across various devices and instances.
Note: This project is a passion project by [T. Jason Weber]. For any feedback or contributions, please open an issue or contact me directly.
Important: ConfigSync interacts with configuration files in protected directories, which may cause some antivirus software to flag it as suspicious or impact performance. For details on this and how to resolve it, see the Antivirus & Performance Considerations section in the FAQ.
- Features
- Why ConfigSync?
- How It Works
- Installation
- Usage
- Configuration
- Logs
- Supported Programs
- Troubleshooting
- License
- Contributing
- Acknowledgements
-
Backup and Restore
Save and restore configuration settings for over 20 supported programs. You can specify a particular date (timestamp) or revert to the latest save. -
Automatic Version Control
ConfigSync maintains distinct backups by timestamps, making it easy to return to any previous state. -
Scheduled Tasks
Automate backups with configurable scheduling. Backups can run daily or hourly without user intervention. -
Safety Mechanisms
Includes features like pre-restore backups to prevent accidental data loss should something go wrong. -
Detailed Logs
Each sync or restore operation is logged with timestamps, messages, and error details. -
Rich Configuration
Fine-tune how many backups to keep, scheduling frequencies, editor preferences, and more.
-
Frictionless Multi-Device Workflow
Move from one machine to another without having to reconfigure your favorite programs each time. -
Hash-Based Checks
ConfigSync doesn’t rewrite or store duplicate data when nothing has changed, saving time and space. -
Safe Recovery
If a restore goes awry, you can revert back to a prior state quickly using the pre-restore backup. -
Granular Control
Only want to sync a particular program’s settings? Or do you want to sync everything at once? ConfigSync has you covered with simple CLI commands.
-
Backup Configurations
- ConfigSync first checks if a program’s existing configurations match what’s in the current archive by computing file hashes.
- If it detects any differences (i.e., the program is “out of sync”), it creates a brand-new “full save” that includes all the program’s configuration files.
- By doing so, you always have multiple complete snapshots for each date. If ConfigSync were to only copy or overwrite changed files, it could complicate the archive structure and make it harder to revert to distinct states in time.
-
Restore Configurations
- Easily revert to a specific timestamp using
--date [YYYY-MM-DD]
. - ConfigSync also creates a pre-restore backup before overwriting files to safeguard against partial or failed restores.
- Easily revert to a specific timestamp using
-
Synchronization
- Keep your program configurations in sync across multiple devices by running or scheduling sync commands.
- Each “out of sync” detection triggers a new, fully contained save, ensuring a complete record of state changes over time.
Note: Although ConfigSync compares file hashes for checking sync status, it doesn’t rely on partial or differential backups. Instead, it maintains separate, complete snapshots for every save date. This approach simplifies restoration and preserves a clear history of each program’s configuration.
- Windows 10 (or later)
- C++ Compiler (e.g., G++ (e.g. ucrt64), Visual Studio, MSVC, Clang)
- Boost Libraries (optional headers like
<boost/uuid>
,<boost/property_tree>
, etc. as used inmain.cpp
) - C++ Redistributables (if required by your system)
Optional: For editing the
settings.json
directly, having an editor like Notepad, Vim, or VSCode is helpful.
-
Clone the Repository
git clone https://github.com/YourUsername/ConfigSync.git cd ConfigSync
-
Build the Project
Use your preferred method, such as Visual Studio, CMake, or a command-line compiler:# Example with Visual Studio Developer Command Prompt cl /EHsc main.cpp /I C:\Path\To\boost_<version> /FeConfigSync.exe
Or using MinGW g++:
g++ -std=c++17 -I C:/Path/To/boost_<version> -o ConfigSync.exe main.cpp ConfigSync.hpp
-
Run the Executable
ConfigSync.exe
If you see a copyright notice, everything was built successfully!
Below is an optional section you can add under Installation or in a dedicated Compilation section to clarify your use of the ucrt64 toolchain, the differences from older MinGW, and how people can use your custom building tool or .versiontool
file.
All commands follow the pattern:
configsync [COMMAND] [OPTIONS] [--flags]
-
Synchronize (Backup) a Specific Program
configsync sync [program-name]
Example:
configsync sync notepad++ --message "Before plugin update"
-
Restore Configurations
configsync restore [program-name] [--date YYYY-MM-DD] [--force]
--force
: Kills the program’s running processes before restoring (if needed).
-
List Supported Programs
configsync list
-
Check Synchronization Status
configsync status # Checks all programs configsync status paint # Checks only Paint config
-
View Saved Dates for a Program
configsync show [program-name]
This displays timestamps and optional messages for each save.
-
Undo (Restore the “Pre-Restore-Backup”)
configsync undo [program-name] --restore [--date YYYY-MM-DD] [--force]
Roll back a restore operation by applying the pre-restore backup if something went wrong.
-
Delete Oldest Saves
configsync delete [program-name] --number X
This removes the X oldest saves to free up space if you exceed your limit.
-
Settings Management
# View current settings configsync settings # Reset a specific setting (example: taskfrequency) configsync settings --reset taskfrequency # Open raw JSON file in your preferred editor configsync settings --json
The
settings
command is extensive; usehelp
for details or view the next section below.
For more detailed command usage, run:
configsync --help
In settings.json
, you will find (at minimum) the following keys:
savelimit
: Maximum number of saves to keep per program.pre-restore-limit
: Number of pre-restore backups to maintain.task
: Enable or disable scheduled tasks (true
orfalse
).taskfrequency
: Frequency for scheduled tasks (e.g.,"daily,1"
).editor
: Preferred text editor for openingsettings.json
(e.g.,"vscode"
,"vim"
,"notepad"
).
The settings.json
is located in the same folder as ConfigSync.exe
. Example snippet:
{
"settingsID": 1,
"savelimit": 60,
"pre-restore-limit": 60,
"task": false,
"taskfrequency": "daily,1",
"editor": "vscode"
}
Warning: Modifying this file incorrectly may cause parse errors. Always back it up or use
configsync settings
to make changes safely.
ConfigSync produces detailed logs in the logs
directory, found alongside the executable. Each log is named by timestamp:
logs
┣ 2024-12-21_14-23-05.log
┣ 2024-12-21_15-32-01.log
┗ ...
Logs contain:
- Timestamps for each action (sync, restore, error).
- Error Messages in case of runtime or filesystem errors.
- Summary of operations performed.
ConfigSync currently supports over 20 programs, ranging from text editors to IDEs. You can see the full list by running:
configsync list
New programs can be added by editing the internal
Programs::Mgm
mappings (found in the source code).
- Calibre
- Chatterino
- CMD-Macros
- Deemix
- Elgato-StreamDeck
- Filen
- foobar2000-v2
- Fusion360
- Google.Chrome
- Jackett
- JDownloader
- Microsoft.PowerToys
- Microsoft.VisualStudioCode
- Mozilla.Firefox
- Mp3tag
- OBS-Studio
- Powershell-Macros
- Prowlarr
- qBittorrent
- Steam
- Ultimaker.Cura
-
“No saves found” error
- Ensure you have synchronized (backup) at least once for the target program.
- Check if you’re referencing the correct program name (use
configsync list
to confirm).
-
Scheduled Task Doesn’t Run
- Confirm you have enabled tasks:
configsync settings.task true
. - Verify the task was created by running
configsync check --task
. - Windows Defender might flag tasks incorrectly; you may need to whitelist them.
- Confirm you have enabled tasks:
-
Restore Fails or Partially Works
- Run restore again with
--force
to close any running instances that might lock files. - Check logs in the
logs
folder for any errors.
- Run restore again with
-
Incorrect Paths or Hard-Coded Directories
- Certain programs (like Calibre) may store absolute paths in config. Ensure both machines have the same directory structure if you want perfect interoperability.
-
JSON Parse Errors
- If your
settings.json
is corrupt, runconfigsync settings --reset --all
to revert to defaults.
- If your
ConfigSync can be built on Windows using various toolchains. Below is guidance if you want to use the ucrt64 toolchain (recommended) or if you prefer the older MinGW-based approach.
- ucrt64 is a newer MinGW-w64 environment that uses the Universal C Runtime (UCRT) instead of the older MSVCRT.
- Compiled applications often require fewer external DLLs, and the runtime is generally more up to date.
- If you rely on UNIX-like commands (e.g.,
touch
,cp
), you may need to install additional MSYS2 tools:pacman -S msys/coreutils
- Installation of the main toolchain:
pacman -S --needed mingw-w64-ucrt-x86_64-toolchain
-
MinGW (MSVCRT)
- Considered “older” but was widely used for a long time.
- Often requires
msys-2.0.dll
at runtime. - May be deprecated or EOL soon in some contexts.
-
ucrt64 (MinGW-w64 with Universal CRT)
- Newer, uses Microsoft’s Universal C Runtime (UCRT).
- May need extra packages for Unix-like utilities (e.g.,
coreutils
). - Generally preferred moving forward.
You’ll notice a .versiontool
file in the repository, which automates building by specifying most compile flags and libraries. You can either:
-
Use Your Custom Building Tool
- If you have a custom C++ build tool that reads
.versiontool
, simply run it according to your documentation. This tool will parse the file and construct the rightg++
command automatically.
- If you have a custom C++ build tool that reads
-
Manually Copy the Compile Command
- Open
.versiontool
and look for a line similar to:g++ main.cpp -o ConfigSync.exe -std=c++23 -static-libgcc -static-libstdc++ -Wl,-Bstatic \ -lstdc++ -lpthread -lbcrypt -lssl -lcrypto -lboost_filesystem-mt -lz -O3
- Adjust the paths for Boost and any libraries needed on your system, then run it in a MinGW-w64 UCRT64 shell.
- Open
Note: Some libraries, like
openssl
,crypto
, orboost_filesystem-mt
, may need to be installed. Usepacman -S <package>
(in MSYS2) to ensure these dependencies are present.
From an MSYS2 MinGW-ucrt64 shell, you might do something like:
# Install necessary packages
pacman -S --needed mingw-w64-ucrt-x86_64-boost mingw-w64-ucrt-x86_64-openssl msys/coreutils
# Navigate to the project folder
cd /c/path/to/ConfigSync
# Run the g++ command (either from .versiontool or manually typed)
g++ main.cpp -o ConfigSync.exe -std=c++23 -static-libgcc -static-libstdc++ \
-Wl,-Bstatic -lstdc++ -lpthread -lbcrypt -lssl -lcrypto -lboost_filesystem-mt -lz -O3
After successful compilation, you can run:
./ConfigSync.exe
(or ConfigSync.exe
from Windows Explorer).
ConfigSync also supports syncing macros or aliases for the Windows Command Prompt (CMD) and PowerShell:
-
CMD-Macros
By default, CMD macros (or aliases) are stored in a.doskey
file. To ensure these macros are loaded whenever you open a CMD window, you can add a registry entry:reg add "HKCU\Software\Microsoft\Command Processor" /v Autorun /d "doskey /macrofile=c:\data\<username>\software\settings\cmd\profile\macros.doskey" /f
You can verify the entry by running:
reg query "HKCU\Software\Microsoft\Command Processor" /v Autorun
With ConfigSync, you can back up and restore this
.doskey
file and keep the macros consistent across machines. -
PowerShell-Macros
PowerShell aliases (or functions) are often stored in a user profile script (e.g.,$PROFILE
). For easy synchronization and backup:- Create a file at
C:\Data\<username>\Software\Settings\Powershell\profile\Microsoft.PowerShell_profile.ps1
. - Copy the contents of your existing
$PROFILE
into that file. - Replace the original
$PROFILE
content with:$profile = "C:\Data\<username>\Software\Settings\Powershell\profile\Microsoft.PowerShell_profile.ps1" . $profile
This way, ConfigSync can back up the file
Microsoft.PowerShell_profile.ps1
, letting you restore or share your custom aliases on other systems. - Create a file at
Tip: ConfigSync sees these macros as just another set of configuration files to back up and restore. Simply add them to your list of supported “programs” (e.g.,
CMD-Macros
,Powershell-Macros
), and ConfigSync will track their changes, store them in the archive, and allow easy rollback or synchronization across devices.
ConfigSync is proprietary software. Use and modification of the code are subject to the terms in the Copyright Disclaimer.
Your feedback and improvements are welcome! However, as this is a proprietary project, please reach out to [T. Jason Weber] for permission if you wish to submit larger changes or add new features.
Ways to contribute:
- Bug Reports: Create an issue on GitHub with detailed logs.
- Feature Requests: Open a discussion or issue describing the feature.
- New Program Support: Submit suggestions for new program configuration paths or open a PR once approved.
- Boost Libraries – For property trees, UUIDs, and filesystem support.
- Open-Source Community – Inspiration for many patterns and solutions used here.
- Special thanks to everyone who has tested, reported bugs, or suggested features.
Happy Syncing!
If you find ConfigSync helpful, consider sharing it with others who might also benefit.
Because ConfigSync copies configuration files from various applications, certain antivirus software (including Windows Defender) may flag it as potentially suspicious. Rest assured, ConfigSync does not contain any malicious code; it simply needs to access and copy files that are often located in protected directories.
-
Antivirus Flags
- If you see a warning from Microsoft Defender or another AV, you may safely whitelist the
ConfigSync.exe
executable and its folder. - This alert often arises because reading and copying files from multiple applications’ folders can be interpreted as suspicious behavior.
- If you see a warning from Microsoft Defender or another AV, you may safely whitelist the
-
Slower Syncing Under Real-Time Protection
- When real-time protection is active, antivirus software scans every file read and write operation. This includes computing hashes (to detect changes) and copying files (during backups or restores).
- As a result, syncing may appear slower, but it is primarily due to the overhead from the AV scans rather than any inefficiency in ConfigSync itself.
- If you find the performance impact significant, consider temporarily disabling real-time protection or adding ConfigSync’s working directory to your AV exclusions.
Because ConfigSync doesn’t rely on cloud storage, you’ll need to manually copy the tool and its data from one machine to another. Fortunately, this is straightforward:
-
Locate Your Current Installation
- By default, if you used the
ConfigSync-Setup.exe
installer, the program’s files reside in:%LOCALAPPDATA%\ConfigSync
- If you built or placed
ConfigSync.exe
elsewhere, look for the folder containing bothConfigSync.exe
and subfolders likeConfigArchive
,PreRestoreBackups
, and anobjects
folder with theSaves.bin
file.
- By default, if you used the
-
Copy the Entire Folder
- Copy this entire directory (including
ConfigSync.exe
,ConfigArchive
,PreRestoreBackups
,objects
, etc.) onto your new system. - You can place it in any convenient directory or drive (e.g.,
D:\Utilities\ConfigSync
).
- Copy this entire directory (including
-
Run
ConfigSync.exe
on the New Machine- Upon launch, ConfigSync automatically detects the current drive letter, the active username, and the parent folder (
pLocat
) ofConfigSync.exe
. - It compares these new values against what was stored in your existing backups.
- If a mismatch is found (e.g., different drive letter or username), ConfigSync dynamically updates the saved paths for that environment, ensuring consistency with your new machine’s file paths.
- Upon launch, ConfigSync automatically detects the current drive letter, the active username, and the parent folder (
- Absolute Paths in the Archive
Each configuration file’s path (e.g.,C:\Users\OldUser\AppData\Roaming\...
) is stored in the internal saves. - Dynamic Updates on Different Machines
In the source code, you’ll see checks likecmp_root
andreplace_root
orcmp_uname
andreplace_uname
. These functions detect when the drive letter (root) or the Windows username is different and automatically update all archived paths to match the new environment. - Relative Directories Around
ConfigSync.exe
The application also constructs folders likeConfigArchive
orobjects\Saves.bin
relative to whereverConfigSync.exe
is found, thanks to:This allows you to runpLocatFull = boost::dll::program_location().string(); pLocat = boost::dll::program_location().parent_path().string(); archiveDir = pLocat + "\\ConfigArchive"; ...
ConfigSync.exe
from any folder without needing a fixed path.
- Program-Specific Hard-Coded Paths
Some programs (e.g., Calibre, certain game launchers) store absolute paths within their own config files, which may not dynamically adapt if you install them to a completely different directory on the new machine. ConfigSync will still restore these files, but the program itself might expect them to exist in the original location. - Username Changes
ConfigSync does its best to rewrite stored paths for the new username. However, if a program references your username in places beyond simple file paths (e.g., deep within the program’s own logic), further manual adjustments may be needed.
In most cases, you can freely move
ConfigSync.exe
to a new location or drive and copy its entire folder to another machine. Upon the first run, ConfigSync’s internal path-adjustment logic ensures your backups remain valid and usable in the new environment.