element-hq / element-hq/synapse
Some background jobs need to be manually re-run after using the postgresql port script
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#9758](https://github.com/matrix-org/synapse/issues/9758).
---
### Description
I followed the steps in https://github.com/matrix-org/synapse/blob/develop/docs/postgres.md in order to port synapse db from sqlite3 to postgresql. After having finished I couldn't find existing users via the direct chat dialog ("search_all_users" was true).
Maybe the port script is broken?
### Steps to reproduce
- follow the porting steps in the link above
- try searching for users
I would expect to find users after porting to postgresql.
### Version information
- **Homeserver**:
If not matrix.org:
- **Version**: "server_version":"1.30.1","python_version":"3.8.5"
- **Platform**: Debian
### Workaround
Thanks to Aaron I could get this to work via:
INSERT INTO background_updates (update_name, progress_json) VALUES
('populate_user_directory_createtables', '{}');
-- Run through each room and update the user directory according to who is in it
INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
('populate_user_directory_process_rooms', '{}', 'populate_user_directory_createtables');
-- Insert all users, if search_all_users is on
INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
('populate_user_directory_process_users', '{}', 'populate_user_directory_process_rooms');
-- Clean up staging tables
INSERT INTO background_updates (update_name, progress_json, depends_on) VALUES
('populate_user_directory_cleanup', '{}', 'populate_user_directory_process_users');
Contributor guide
Assessment
This issue has not been assessed yet.