NAK is really cool indeed
And this sync options reminds me of the drush sql-sync command I use very often to sync db data between Drupal instance 🤓 https://www.drush.org/12.x/commands/sql_sync/
[nak](https://github.com/fiatjaf/nak) is an awesome command-line tool written in Rust (jk, written in Go) for doing Nostr stuff. I use it on a daily basis to talk to relays and gather events.
Using nak, you can sync your data between one relay and another like this:
```sh
nak req -a
```
For example:
```sh
nak req -a 0461fcbecc4c3374439932d6b8f11269ccdb7cc973ad7a50ae362db135a474dd wss://gleasonator.dev/relay | nak event wss://slime.church/relay
```
This downloads all data by the **author** (`-a`) from relay 1, and pipes it into relay 2.
Most relays only return about 100 events at a time, though. To sync _everything_ you will need to implement some sort of pagination with `since` and `until` filters.
Most commonly I just need to sync my profile data to a new relay, which can be done with the `-k` (kind) flag. You can pass multiple `-k` flags, eg:
```sh
nak req -k 0 -k 3 -k 10000 -k 10001 -k 10002 -k 10003 -a 0461fcbecc4c3374439932d6b8f11269ccdb7cc973ad7a50ae362db135a474dd wss://gleasonator.dev/relay | nak event wss://slime.church/relay
```
This will migrate your profile, your follow list, your relay list, your mute list, pinned posts, and your bookmarks to the new relay.
If you find yourself doing this often, you can drop a little alias in your bashrc/zshrc:
```sh
alias nsync="nak req -k 0 -k 3 -k 10000 -k 10001 -k 10002 -k 10003 -a 0461fcbecc4c3374439932d6b8f11269ccdb7cc973ad7a50ae362db135a474dd wss://gleasonator.dev/relay | nak event"
```
Then you'll just `nsync
NAK is really cool indeed
And this sync options reminds me of the drush sql-sync command I use very often to sync db data between Drupal instance 🤓 https://www.drush.org/12.x/commands/sql_sync/
No replies yet.