New 2

	result.Attributes = await dbContext.DocumentAttributes
		.AsNoTracking()
		.Where(a => a.DocumentRef == doc.Id && a.Enabled)
		.OrderBy(a => a.AttributeKey)
		.ToDictionaryAsync(a => a.AttributeKey, a => a.Value);


	if (children)
		result.Children = await Children(doc.Id);
	else
		result.Children = [];

	var refs = await dbContext.References
		.AsNoTracking()
		.GroupJoin(dbContext.Documents, r => r.ReferenceTo, d => d.Id, (r, d) => new { r, d })
		.Where(rd => rd.r.DocumentRef == doc.Id)
		.SelectMany(
			rd => rd.d.DefaultIfEmpty(),
				(r, d) => new Reference(r.r.ReferenceTo, d.Path, r.r.MediaLink, mediaHost))
		.ToDictionaryAsync(r => r.Pattern, r => r.Replacement);

	result.Summary = ReplaceRefs(result.Summary, refs);
	result.CoverPicture = ReplaceRefs(result.CoverPicture, refs);
	target_lxd, err := srv.lxd.GetNewClient(target_node)
	if err != nil {
		srv.log.Error(err).Container(container.Name).Msg("Connect to LXD service on target node '%s'.", target_node)
		return customerror.NewError(customerror.ErrServiceUnavailable, "Cannot connect to LXD.")
	}
	source_lxd, err := srv.lxd.GetNewClient(container.Node)
	if err != nil {
		srv.log.Error(err).Container(container.Name).Msg("Connect to LXD service on source node '%s'.", container.Node)
		return customerror.NewError(customerror.ErrServiceUnavailable, "Cannot connect to LXD.")
	}

	if err := source_lxd.Migrate(container.Name, target_lxd); err != nil {
		return err
	}