Skip to content

Instantly share code, notes, and snippets.

@nakamuraos
Last active November 26, 2025 07:42
Show Gist options
  • Select an option

  • Save nakamuraos/717eb99b5e145ed11cd754ad3714b302 to your computer and use it in GitHub Desktop.

Select an option

Save nakamuraos/717eb99b5e145ed11cd754ad3714b302 to your computer and use it in GitHub Desktop.
Reset trial Navicat 15, Navicat 16, Navicat 17 on Linux
#!/bin/bash
set -euo pipefail
# Author: NakamuraOS <https://github.com/nakamuraos>
# Latest update: 03/19/2025
# Tested with Navicat 15.x, 16.x, and 17.x on Debian and Ubuntu.
BGRED="\e[1;97;41m"
ENDCOLOR="\e[0m"
echo -e "${BGRED} ${ENDCOLOR}"
echo -e "${BGRED} ┌──────────────────────────────────────┐ ${ENDCOLOR}"
echo -e "${BGRED} │ !!! WARNING !!! │ ${ENDCOLOR}"
echo -e "${BGRED} ├──────────────────────────────────────┤ ${ENDCOLOR}"
echo -e "${BGRED} │ ALL DATA can be destroyed. │ ${ENDCOLOR}"
echo -e "${BGRED} │ Always BACKUP before continuing. │ ${ENDCOLOR}"
echo -e "${BGRED} └──────────────────────────────────────┘ ${ENDCOLOR}"
echo -e "${BGRED} ${ENDCOLOR}"
echo -e "Report issues:\n> https://gist.github.com/nakamuraos/717eb99b5e145ed11cd754ad3714b302\n"
echo -e "Reset trial \e[1mNavicat Premium\e[0m:"
if [[ ! "${1:-}" =~ ^--?[Yy]([eE][sS])?$ ]]; then
read -p "Are you sure? (y/N) " -r
echo
if [[ ! $REPLY =~ ^[Yy]([eE][sS])?$ ]]; then
echo "Aborted."
exit 0
fi
fi
echo "Starting reset..."
DATE=$(date '+%Y%m%d_%H%M%S')
# Backup
echo "=> Creating a backup..."
mkdir -p ~/.config/dconf/user-backup ~/.config/navicat/Premium/preferences-backup
cp ~/.config/dconf/user ~/.config/dconf/user-backup/user.$DATE
echo "The user dconf backup was created at $HOME/.config/dconf/user-backup/user.$DATE"
cp ~/.config/navicat/Premium/preferences.json ~/.config/navicat/Premium/preferences-backup/preferences.json.$DATE
echo "The Navicat preferences backup was created at $HOME/.config/navicat/Premium/preferences-backup/preferences.json.$DATE"
if ! command -v dconf &>/dev/null; then
echo "=> dconf is not installed. Installing..."
if command -v apt-get &>/dev/null; then
sudo apt-get update
sudo apt-get install -y dconf-cli
elif command -v dnf &>/dev/null; then
sudo dnf install -y dconf
elif command -v yum &>/dev/null; then
sudo yum install -y dconf
elif command -v pacman &>/dev/null; then
sudo pacman -Sy --noconfirm dconf
else
echo "Package manager not supported. Please install dconf manually."
exit 1
fi
fi
# Clear data in dconf
echo "=> Resetting..."
dconf reset -f /com/premiumsoft/navicat-premium/
echo "The user dconf data was reset"
# Remove data fields in config file
sed -i -E 's/,?"([A-F0-9]+)":\{([^\}]+)},?//g' ~/.config/navicat/Premium/preferences.json
echo "The Navicat preferences was reset"
# Done
echo "Done."
exit 0
@nakamuraos
Copy link
Author

@yoshiosdw, did you close Navicat before running this script? Your log shows Navicat was still open when you executed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment