sync and purge docs