# Change ownership of all posts by a specific user

**URL:** https://meta.discourse.org/t/change-ownership-of-all-posts-by-a-specific-user/48921
**Category:** Self-Hosting
**Tags:** how-to
**Created:** [2016 年 8 月 20 日午後 3:30 UTC](https://meta.discourse.org/t/change-ownership-of-all-posts-by-a-specific-user/48921 "2016-08-20T15:30:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [2016 年 8 月 20 日午後 3:30 UTC](https://meta.discourse.org/t/change-ownership-of-all-posts-by-a-specific-user/48921/1 "2016-08-20T15:30:02Z")

</div>

> 🔖 This guide outlines the process to change the ownership of all posts by a specific user. This task requires console access.
> 
> 🙋 Required user level: Server administrator with SSH access

In Discourse, there may be situations where you need to change the ownership of all posts by a specific user. This guide provides the steps for achieving this on self-hosted Discourse instances. If you’re using Discourse hosting, please contact the support team at [team@discourse.org](mailto:team@discourse.org) for assistance with this process.

## Access your site

1. Connect to your Droplet via SSH.

2. Enter the Docker container for your Discourse instance by running the following commands:

## Changing ownership of all public posts

To transfer ownership of all public topics/posts from one user to another, use the following command:

```bash
rake users:change_post_ownership["old_username","new_username"]

```

Replace `old_username` with the current owner’s username and `new_username` with the new owner’s username.

## Changing ownership of all private posts

To change the ownership of all private messages (topics/posts), execute the command below:

```bash
rake users:change_post_ownership["old_username","new_username",private]

```

Again, replace `old_username` and `new_username` with the relevant usernames.

> Last edited by @SaraDev 2024-10-30T23:17:15Z
> 
> > **Check document**
> >
> > Perform check on document:
